[libvirt] [PATCH] qemuProcessLaunch: Return earlier if spawning qemu failed
by Michal Privoznik
If spawning qemu fails then we report an error and proceed to
writing status XML onto the disk. This is unnecessary as we are
sure that the domain is not running.
At the same time, if virPidFileReadPath() fails it returns
-errno. Use it in the error message. It may explain what went
wrong.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_process.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 90466771cd..5b5864c021 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6624,16 +6624,18 @@ qemuProcessLaunch(virConnectPtr conn,
/* wait for qemu process to show up */
if (rv == 0) {
- if (virPidFileReadPath(priv->pidfile, &vm->pid) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Domain %s didn't show up"), vm->def->name);
- rv = -1;
+ if ((rv = virPidFileReadPath(priv->pidfile, &vm->pid)) < 0) {
+ virReportSystemError(-rv,
+ _("Domain %s didn't show up"),
+ vm->def->name);
+ goto cleanup;
}
VIR_DEBUG("QEMU vm=%p name=%s running with pid=%lld",
vm, vm->def->name, (long long)vm->pid);
} else {
VIR_DEBUG("QEMU vm=%p name=%s failed to spawn",
vm, vm->def->name);
+ goto cleanup;
}
VIR_DEBUG("Writing early domain status to disk");
--
2.21.0
5 years, 5 months
[libvirt] [PATCHv3 0/5] Implement debugcon chardev
by Ján Tomko
v2: https://www.redhat.com/archives/libvir-list/2019-February/msg00293.html
v3:
* dropped the pointless isa-prefix
* use DO_TEST_CAPS_LATEST
* trimmed the XML
* compiles with gcc
* only make irq optional
* autofill iobase
Ján Tomko (3):
qemu: introduce qemuDomainChrSerialTargetModel
qemu: make irq optional when formatting the ISA address
qemu: autoadd iobase to debugcon chardev
Nikolay Shirokovskiy (2):
conf: add debugcon chardev guest interface
qemu: implement debugcon chardev
docs/formatdomain.html.in | 3 +-
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 5 ++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 25 +++++++++++++---
src/qemu/qemu_domain.c | 12 ++++++++
.../isa-serial-debugcon.x86_64-latest.args | 30 +++++++++++++++++++
.../qemuxml2argvdata/isa-serial-debugcon.xml | 21 +++++++++++++
tests/qemuxml2argvtest.c | 1 +
.../isa-serial-debugcon.xml | 30 +++++++++++++++++++
tests/qemuxml2xmltest.c | 2 ++
11 files changed, 126 insertions(+), 5 deletions(-)
create mode 100644 tests/qemuxml2argvdata/isa-serial-debugcon.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/isa-serial-debugcon.xml
create mode 100644 tests/qemuxml2xmloutdata/isa-serial-debugcon.xml
--
2.19.2
5 years, 5 months
[libvirt] [security-notice PATCH 0/9] various improvements to script for finding broken/fixed branches/tags
by Daniel P. Berrangé
This series provides for much greater automation when publishing
details of security flaws. It is now possible to just provide the broken
and fixed commit hash on the master branch. All the tag info and details
of branches are now filled in automatically.
Daniel P. Berrangé (9):
scripts: change data structures used to track branches & tags
scripts: report vulnerable branches which don't have any tags too
scripts: add ability to handle a fixed commit hash
scripts: change to update notice files inplace
scripts: allow for notices to have multiple commit hashes
scripts: optimize tag to branch mapping
scripts: add detection of cherry-picks in branches
scripts: fuzzy matching on subject to identify unannotated cherry
picks
notices: re-generate all branch/tag info
notices/2008/0001.xml | 6 -
notices/2009/0001.xml | 2 +
notices/2010/0001.xml | 3 -
notices/2010/0002.xml | 3 -
notices/2010/0004.xml | 2 +-
notices/2011/0001.xml | 10 +-
notices/2011/0002.xml | 4 +
notices/2012/0001.xml | 14 +-
notices/2012/0002.xml | 2 +-
notices/2012/0003.xml | 4 +
notices/2013/0001.xml | 8 +
notices/2013/0002.xml | 8 +
notices/2013/0003.xml | 21 ++
notices/2013/0005.xml | 2 +-
notices/2013/0006.xml | 1 +
notices/2013/0007.xml | 2 +-
notices/2013/0010.xml | 16 +-
notices/2013/0012.xml | 28 ++-
notices/2013/0015.xml | 2 +-
notices/2013/0016.xml | 22 ++-
notices/2013/0018.xml | 102 +++++-----
notices/2013/0020.xml | 68 ++++---
notices/2013/0021.xml | 2 +-
notices/2014/0001.xml | 8 +
notices/2014/0003.xml | 107 ++++++++--
notices/2014/0004.xml | 25 ++-
notices/2014/0005.xml | 21 +-
notices/2014/0006.xml | 22 ++-
notices/2014/0007.xml | 18 +-
notices/2014/0008.xml | 6 +-
notices/2014/0009.xml | 5 +-
notices/2014/0010.xml | 8 +-
notices/2015/0001.xml | 10 +-
notices/2015/0002.xml | 6 +-
notices/2015/0003.xml | 14 +-
notices/2015/0004.xml | 13 +-
notices/2016/0001.xml | 4 +-
notices/2016/0002.xml | 1 +
notices/2017/0001.xml | 4 +-
notices/2017/0002.xml | 6 +-
notices/2018/0001.xml | 159 ++++++++++++++-
notices/2018/0002.xml | 158 ++++++++++++++-
notices/2018/0003.xml | 161 ++++++++++++++-
notices/2018/0004.xml | 159 ++++++++++++++-
notices/2018/0005.xml | 162 ++++++++++++++-
notices/2019/0001.xml | 2 +-
notices/2019/0002.xml | 2 +-
scripts/report-vulnerable-tags.pl | 319 ++++++++++++++++++++++++++----
48 files changed, 1507 insertions(+), 225 deletions(-)
--
2.21.0
5 years, 5 months
[libvirt] [PATCH v6 00/23] network: refactor to decouple virt drivers from network driver
by Daniel P. Berrangé
An update to
v1: https://www.redhat.com/archives/libvir-list/2018-December/msg00681.html
v2: https://www.redhat.com/archives/libvir-list/2019-February/msg01581.html
v3: https://www.redhat.com/archives/libvir-list/2019-March/msg01259.html
v4: https://www.redhat.com/archives/libvir-list/2019-April/msg01186.html
v5: https://www.redhat.com/archives/libvir-list/2019-May/msg00358.html
Currently the network driver registers a set of callbacks with the virt
driver in order to handle allocating/releasing network ports associated
with guest NICs.
This series introduces a virNetworkPortPtr object and associated XML
that describes a network port. The virt drivers now call public APIs
associated with this new object to create/delete ports for guest NICs.
Changed in v6:
- Fixed mistakes in RNG schema & example XML
- Fix docs typos
Changed in v5:
- Separately track ports with type=network vs type=bridge to deal with
fallout after reverting patches which merged them
- Add RNG schema and XML format docs
- Change to use classID attr on <bandwidth> isntead of
of separate <class id="xx"/> element
- Drop obsolete driver deps from RPM spec
- Other misc bug fixes found during testing
Changed in v4:
- Merged the ACKd patches which didn't depend on other un-acked
parts
- Improve bandwidth error messages
- Ensure we set floor sum to zero when starting network
- Misc fixes for previous review comments
NB, I have not added missing docs for the new XML doc format
yet. This is work in progress.
Changed in v3:
- Remove unused API symbol
- Fix dist of test data files
Changed in v2:
- Fix many bugs related to upgrades with running VMs
- Convert over bandwidth controls to the new APIs
- Handle reconnecting VIFs to bridges during startup
- Much much more that I can't remember
Daniel P. Berrangé (23):
conf: allow bandwidth parsing / formatting to include class ID
conf: introduce virNetworkPortDefPtr struct and XML support
network: make networkLogAllocation independent of domain conf
conf: add APIs to convert virDomainNetDef to virNetworkPortDef
network: convert networkAllocateActualDevice to virNetworkPortDef
network: convert networkNotifyActualDevice to virNetworkPortDef
network: convert networkReleaseActualDevice to virNetworkPortDef
network: convert hook script to take a network port XML
network: remove the virDomainNetBandwidthChangeAllowed callback
network: introduce networkAllocatePort
network: introduce networkNotifyPort
network: introduce networkReleasePort
network: introduce networkUpdatePortBandwidth
network: add public APIs for network port object
access: add permissions for network port objects
remote: add support for new network port APIs
virsh: add support for network port APIs
conf: support recording ports against virNetworkObjPtr
network: add implementation of network port APIs
lxc, libxl: notify network driver of NICs during reconnect
lxc, libxl: save domain status after reconnect
conf: record a portid against the domain conf
conf: switch over to use network port APIs for virt drivers
docs/docs.html.in | 1 +
docs/formatdomain.html.in | 8 +
docs/formatnetworkport.html.in | 212 +++
docs/hooks.html.in | 24 +-
docs/schemas/domaincommon.rng | 5 +
docs/schemas/networkcommon.rng | 5 +
docs/schemas/networkport.rng | 154 +++
include/libvirt/libvirt-network.h | 122 ++
include/libvirt/virterror.h | 3 +
libvirt.spec.in | 1 +
src/access/genpolkit.pl | 2 +-
src/access/viraccessdriver.h | 6 +
src/access/viraccessdrivernop.c | 11 +
src/access/viraccessdriverpolkit.c | 26 +
src/access/viraccessdriverstack.c | 25 +
src/access/viraccessmanager.c | 16 +
src/access/viraccessmanager.h | 6 +
src/access/viraccessperm.c | 6 +
src/access/viraccessperm.h | 44 +
src/conf/Makefile.inc.am | 2 +
src/conf/domain_conf.c | 531 +++++++-
src/conf/domain_conf.h | 49 +-
src/conf/netdev_bandwidth_conf.c | 30 +-
src/conf/netdev_bandwidth_conf.h | 2 +
src/conf/network_conf.c | 8 +-
src/conf/virnetworkobj.c | 303 +++++
src/conf/virnetworkobj.h | 34 +
src/conf/virnetworkportdef.c | 508 +++++++
src/conf/virnetworkportdef.h | 113 ++
src/datatypes.c | 60 +
src/datatypes.h | 41 +
src/driver-network.h | 41 +
src/libvirt-network.c | 444 +++++++
src/libvirt_private.syms | 23 +-
src/libvirt_public.syms | 15 +
src/libxl/libxl_driver.c | 33 +
src/lxc/lxc_process.c | 35 +
src/network/bridge_driver.c | 1182 ++++++++++-------
src/qemu/qemu_driver.c | 8 +-
src/remote/remote_daemon_dispatch.c | 73 +
src/remote/remote_driver.c | 69 +
src/remote/remote_protocol.x | 124 +-
src/remote_protocol-structs | 69 +
src/rpc/gendispatch.pl | 18 +-
src/util/virerror.c | 9 +
src/util/virhook.c | 4 +-
src/util/virhook.h | 4 +-
tests/Makefile.am | 7 +
.../net-virtio-network-portgroup.xml | 6 +-
tests/virnetdevbandwidthtest.c | 1 +
.../plug-bridge-mactbl.xml | 9 +
.../virnetworkportxml2xmldata/plug-bridge.xml | 15 +
.../virnetworkportxml2xmldata/plug-direct.xml | 12 +
.../plug-hostdev-pci.xml | 12 +
.../plug-network.xml | 15 +
tests/virnetworkportxml2xmldata/plug-none.xml | 8 +
tests/virnetworkportxml2xmltest.c | 104 ++
tests/virschematest.c | 1 +
tools/virsh-completer.c | 50 +
tools/virsh-completer.h | 4 +
tools/virsh-network.c | 399 +++++-
tools/virsh-network.h | 5 +
62 files changed, 4499 insertions(+), 658 deletions(-)
create mode 100644 docs/formatnetworkport.html.in
create mode 100644 docs/schemas/networkport.rng
create mode 100644 src/conf/virnetworkportdef.c
create mode 100644 src/conf/virnetworkportdef.h
create mode 100644 tests/virnetworkportxml2xmldata/plug-bridge-mactbl.xml
create mode 100644 tests/virnetworkportxml2xmldata/plug-bridge.xml
create mode 100644 tests/virnetworkportxml2xmldata/plug-direct.xml
create mode 100644 tests/virnetworkportxml2xmldata/plug-hostdev-pci.xml
create mode 100644 tests/virnetworkportxml2xmldata/plug-network.xml
create mode 100644 tests/virnetworkportxml2xmldata/plug-none.xml
create mode 100644 tests/virnetworkportxml2xmltest.c
--
2.21.0
5 years, 5 months
Re: [libvirt] [PATCH] storage: escape ipv6 for ceph mon hosts to librados
by Yi Li
> >Hosts for rbd are ceph monitor daemons. These have fixed IP addresses,
> >so they are often referenced by IP rather than hostname for
> >convenience, or to avoid relying on DNS. Using IPv4 addresses as the
> >host name works already, but IPv6 addresses require rbd-specific
>
> If you include the escaping in the XML, does it currently work?
> <host name='[2205::192:168:205:141]' port='6789'/>
Yes, It works.
>
>
> >escaping because the colon is used as an option separator in the
> >string passed to librados.
> >
> >Escape these colons, and enclose the IPv6 address in square brackets
> >so it is distinguished from the port, which is currently mandatory.
> >
> >Signed-off-by: Yi Li <yili(a)winhong.com>
> >---
> > docs/schemas/storagepool.rng | 5 ++++-
> > src/storage/storage_backend_rbd.c | 13 ++++++++++---
> > tests/storagepoolxml2xmlin/pool-rbd-ipv6.xml | 13 +++++++++++++
> > tests/storagepoolxml2xmlout/pool-rbd-ipv6.xml | 16 ++++++++++++++++
> > tests/storagepoolxml2xmltest.c | 1 +
> > 5 files changed, 44 insertions(+), 4 deletions(-)
> > create mode 100644 tests/storagepoolxml2xmlin/pool-rbd-ipv6.xml
> > create mode 100644 tests/storagepoolxml2xmlout/pool-rbd-ipv6.xml
> >
> >diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
> >index f8c968e..3056563 100644
> >--- a/src/storage/storage_backend_rbd.c
> >+++ b/src/storage/storage_backend_rbd.c
> >@@ -268,9 +268,16 @@ virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr,
> > source->hosts[i].name);
> > } else if (source->hosts[i].name != NULL &&
> > source->hosts[i].port) {
> >- virBufferAsprintf(&mon_host, "%s:%d,",
> >- source->hosts[i].name,
> >- source->hosts[i].port);
> >+ /* assume host containing : is ipv6 */
> >+ if (strchr(source->hosts[i].name, ':')) {
>
> if (virSocketAddrNumericFamily(listenAddress) == AF_INET6)
>
> By using this helper function, we won't try to escape an address that is
> already escaped.
>
> Also, instead of copying the whole virBuffer call twice, it would be
> nicer to assign the format to a temporary variable like we do in qemuMigrationDstPrepare
>
> Jano
Good point. I'd sending a v2.
>
>
> >+ virBufferAsprintf(&mon_host, "[%s]:%d,",
> >+ source->hosts[i].name,
> >+ source->hosts[i].port);
> >+ } else {
> >+ virBufferAsprintf(&mon_host, "%s:%d,",
> >+ source->hosts[i].name,
> >+ source->hosts[i].port);
> >+ }
> > } else {
> > virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> > _("received malformed monitor, check the XML definition"));
On Sun, Apr 28, 2019 at 1:10 PM winhong-yili <yili(a)winhong.com> wrote:
>
> >Hosts for rbd are ceph monitor daemons. These have fixed IP addresses,
> >so they are often referenced by IP rather than hostname for
> >convenience, or to avoid relying on DNS. Using IPv4 addresses as the
> >host name works already, but IPv6 addresses require rbd-specific
>
> If you include the escaping in the XML, does it currently work?
> <host name='[2205::192:168:205:141]' port='6789'/>
>
> >escaping because the colon is used as an option separator in the
> >string passed to librados.
> >
> >Escape these colons, and enclose the IPv6 address in square brackets
> >so it is distinguished from the port, which is currently mandatory.
> >
> >Signed-off-by: Yi Li <yili(a)winhong.com>
> >---
> > docs/schemas/storagepool.rng | 5 ++++-
> > src/storage/storage_backend_rbd.c | 13 ++++++++++---
> > tests/storagepoolxml2xmlin/pool-rbd-ipv6.xml | 13 +++++++++++++
> > tests/storagepoolxml2xmlout/pool-rbd-ipv6.xml | 16 ++++++++++++++++
> > tests/storagepoolxml2xmltest.c | 1 +
> > 5 files changed, 44 insertions(+), 4 deletions(-)
> > create mode 100644 tests/storagepoolxml2xmlin/pool-rbd-ipv6.xml
> > create mode 100644 tests/storagepoolxml2xmlout/pool-rbd-ipv6.xml
> >
> >diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
> >index f8c968e..3056563 100644
> >--- a/src/storage/storage_backend_rbd.c
> >+++ b/src/storage/storage_backend_rbd.c
> >@@ -268,9 +268,16 @@ virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr,
> > source->hosts[i].name);
> > } else if (source->hosts[i].name != NULL &&
> > source->hosts[i].port) {
> >- virBufferAsprintf(&mon_host, "%s:%d,",
> >- source->hosts[i].name,
> >- source->hosts[i].port);
> >+ /* assume host containing : is ipv6 */
> >+ if (strchr(source->hosts[i].name, ':')) {
>
> if (virSocketAddrNumericFamily(listenAddress) == AF_INET6)
>
> By using this helper function, we won't try to escape an address that is
> already escaped.
>
> Also, instead of copying the whole virBuffer call twice, it would be
> nicer to assign the format to a temporary variable like we do in qemuMigrationDstPrepare
>
> Jano
>
> >+ virBufferAsprintf(&mon_host, "[%s]:%d,",
> >+ source->hosts[i].name,
> >+ source->hosts[i].port);
> >+ } else {
> >+ virBufferAsprintf(&mon_host, "%s:%d,",
> >+ source->hosts[i].name,
> >+ source->hosts[i].port);
> >+ }
> > } else {
> > virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> > _("received malformed monitor, check the XML definition"));
5 years, 5 months
[libvirt] [PATCH v3 00/15] implement cgroups v2 support
by Pavel Hrdina
In cgroups v2 there is no devices controller, eBPF should be used
instead.
Changes in v3:
- removed workaround for kernel bug [1]
- added documentation how to get the eBPF program
Changes in v2:
- fixed build on bsd and older kernels without cgroup BPF
- cgroup bpf devices code moved to separate file
Documentation for eBPF:
<http://man7.org/linux/man-pages/man2/bpf.2.html>
<https://www.kernel.org/doc/Documentation/networking/filter.txt>
<https://docs.cilium.io/en/v1.3/bpf/>
[1] <https://bugzilla.redhat.com/show_bug.cgi?id=1656432>
Pavel Hrdina (15):
util: introduce virbpf helpers
vircgroup: introduce virCgroupV2DevicesAvailable
vircgroup: introduce virCgroupV2DevicesAttachProg
vircgroup: introduce virCgroupV2DevicesDetectProg
vircgroup: introduce virCgroupV2DevicesCreateProg
vircgroup: introduce virCgroupV2DevicesPrepareProg
vircgroup: introduce virCgroupV2DevicesRemoveProg
vircgroup: introduce virCgroupV2DeviceGetPerms
vircgroup: introduce virCgroupV2DevicesGetKey
vircgroup: introduce virCgroupV2AllowDevice
vircgroup: introduce virCgroupV2DenyDevice
vircgroup: introduce virCgroupV2AllowAllDevices
vircgroup: introduce virCgroupV2DenyAllDevices
vircgroup: workaround devices in hybrid mode
vircgroupmock: mock virCgroupV2DevicesAvailable
configure.ac | 6 +
include/libvirt/virterror.h | 2 +
src/Makefile.am | 2 +
src/libvirt_private.syms | 26 ++
src/util/Makefile.inc.am | 4 +
src/util/virbpf.c | 438 +++++++++++++++++++
src/util/virbpf.h | 259 ++++++++++++
src/util/vircgroup.c | 3 +-
src/util/vircgroupbackend.h | 3 +-
src/util/vircgrouppriv.h | 10 +
src/util/vircgroupv1.c | 9 +-
src/util/vircgroupv2.c | 117 +++++-
src/util/vircgroupv2devices.c | 670 ++++++++++++++++++++++++++++++
src/util/vircgroupv2devices.h | 57 +++
src/util/virerror.c | 2 +
tests/vircgroupdata/hybrid.parsed | 2 +-
tests/vircgroupmock.c | 7 +
tests/vircgrouptest.c | 4 +-
18 files changed, 1613 insertions(+), 8 deletions(-)
create mode 100644 src/util/virbpf.c
create mode 100644 src/util/virbpf.h
create mode 100644 src/util/vircgroupv2devices.c
create mode 100644 src/util/vircgroupv2devices.h
--
2.20.1
5 years, 5 months
[libvirt] [PATCH] test_driver: implement virDomainInterfaceAddresses
by Ilias Stamatis
Ignore @source in the case of the test driver and return fixed private
IPv4 addresses for all the interfaces defined in the domain.
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
The default config of the test driver has no guest interfaces defined,
so this must be tested with a custom config.
Maybe it would be a good idea to add one or more guest interfaces in the
default config. I could send an additional patch for this.
src/test/test_driver.c | 71 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index a4c17ef0df..3a81f51a88 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -3220,6 +3220,76 @@ static int testDomainBlockStats(virDomainPtr domain,
return ret;
}
+static int
+testDomainInterfaceAddresses(virDomainPtr dom,
+ virDomainInterfacePtr **ifaces,
+ unsigned int source ATTRIBUTE_UNUSED,
+ unsigned int flags)
+{
+ size_t i;
+ size_t ifaces_count = 0;
+ int ret = -1;
+ char ipaddr[32];
+ char macaddr[VIR_MAC_STRING_BUFLEN];
+ virDomainObjPtr vm = NULL;
+ virDomainInterfacePtr iface = NULL;
+ virDomainInterfacePtr *ifaces_ret = NULL;
+
+ virCheckFlags(0, -1);
+
+ if (!(vm = testDomObjFromDomain(dom)))
+ goto cleanup;
+
+ if (virDomainObjCheckActive(vm) < 0)
+ goto cleanup;
+
+ if (VIR_ALLOC_N(ifaces_ret, vm->def->nnets) < 0)
+ goto cleanup;
+
+ for (i = 0; i < vm->def->nnets; i++) {
+ if (VIR_ALLOC(iface) < 0)
+ goto cleanup;
+
+ if (VIR_STRDUP(iface->name, vm->def->nets[i]->ifname) < 0)
+ goto cleanup;
+
+ virMacAddrFormat(&(vm->def->nets[i]->mac), macaddr);
+ if (VIR_STRDUP(iface->hwaddr, macaddr) < 0)
+ goto cleanup;
+
+ if (VIR_ALLOC(iface->addrs) < 0)
+ goto cleanup;
+
+ iface->addrs[0].type = VIR_IP_ADDR_TYPE_IPV4;
+ iface->addrs[0].prefix = 24;
+
+ sprintf(ipaddr, "192.168.0.%ld", 100 + (i % 155));
+ if (VIR_STRDUP(iface->addrs[0].addr, ipaddr) < 0)
+ goto cleanup;
+
+ iface->naddrs = 1;
+
+ VIR_STEAL_PTR(ifaces_ret[i], iface);
+ ifaces_count++;
+ }
+
+ VIR_STEAL_PTR(*ifaces, ifaces_ret);
+ ret = ifaces_count;
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+
+ if (ifaces_ret) {
+ for (i = 0; i < ifaces_count; i++)
+ virDomainInterfaceFree(ifaces_ret[i]);
+ }
+ virDomainInterfaceFree(iface);
+
+ VIR_FREE(ifaces_ret);
+
+ return ret;
+}
+
static int
testDomainInterfaceStats(virDomainPtr domain,
const char *device,
@@ -6876,6 +6946,7 @@ static virHypervisorDriver testHypervisorDriver = {
.domainSetSchedulerParameters = testDomainSetSchedulerParameters, /* 0.3.2 */
.domainSetSchedulerParametersFlags = testDomainSetSchedulerParametersFlags, /* 0.9.2 */
.domainBlockStats = testDomainBlockStats, /* 0.7.0 */
+ .domainInterfaceAddresses = testDomainInterfaceAddresses, /* 5.4.0 */
.domainInterfaceStats = testDomainInterfaceStats, /* 0.7.0 */
.nodeGetCellsFreeMemory = testNodeGetCellsFreeMemory, /* 0.4.2 */
.connectDomainEventRegister = testConnectDomainEventRegister, /* 0.6.0 */
--
2.21.0
5 years, 5 months
[libvirt] [PATCH v4 0/3] numa: deprecate '-numa node, mem' and default memory distribution
by Igor Mammedov
Changes since v3:
- simplify series by dropping idea of showing property values in "qom-list-properties"
and use MachineInfo in QAPI schema instead
Changes since v2:
- taking in account previous review, implement a way for mgmt to intospect if
'-numa node,mem' is supported by machine type as suggested by Daniel at
https://www.mail-archive.com/qemu-devel@nongnu.org/msg601220.html
* ammend "qom-list-properties" to show property values
* add "numa-mem-supported" machine property to reflect if '-numa node,mem=SZ'
is supported. It culd be used with '-machine none' or at runtime with
--preconfig before numa memory mapping are configured
* minor fixes to deprecation documentation mentioning "numa-mem-supported" property
1) "I'm considering to deprecating -mem-path/prealloc CLI options and replacing
them with a single memdev Machine property to allow interested users to pick
used backend for initial RAM (fixes mixed -mem-path+hostmem backends issues)
and as a transition step to modeling initial RAM as a Device instead of
(ab)using MemoryRegion APIs."
(for more details see: https://www.mail-archive.com/qemu-devel@nongnu.org/msg596314.html)
However there is a couple of roadblocks on the way (s390x and numa memory handling).
I think I finally thought out a way to hack s390x in migration compatible manner,
but I don't see any way to do it for -numa node,mem and default RAM assignement
to nodes. Considering both numa usecases aren't meaningfully using NUMA (aside
guest side testing) and could be replaced with explicitly used memdev parameter,
I'd like to propose removing these fake NUMA friends on new machine types,
hence this deprecation. And once the last machie type that supported the option
is removed we would be able to remove option altogether.
As result of removing deprecated options and replacing initial RAM allocation
with 'memdev's (1), QEMU will allocate guest RAM in consistent way, fixing mixed
use-case and allowing boards to move towards modelling initial RAM as Device(s).
Which in its own turn should allow to cleanup NUMA/HMP/memory accounting code
more by dropping ad-hoc node_mem tracking and reusing memory device enumeration
instead.
Reference to previous versions:
* https://www.mail-archive.com/qemu-devel@nongnu.org/msg617694.html
CC: libvir-list(a)redhat.com
CC: ehabkost(a)redhat.com
CC: pbonzini(a)redhat.com
CC: berrange(a)redhat.com
CC: armbru(a)redhat.com
Igor Mammedov (3):
machine: show if CLI option '-numa node,mem' is supported in QAPI
schema
numa: deprecate 'mem' parameter of '-numa node' option
numa: deprecate implict memory distribution between nodes
include/hw/boards.h | 3 +++
hw/arm/virt.c | 1 +
hw/i386/pc.c | 1 +
hw/ppc/spapr.c | 1 +
numa.c | 5 +++++
qapi/misc.json | 5 ++++-
qemu-deprecated.texi | 24 ++++++++++++++++++++++++
vl.c | 1 +
8 files changed, 40 insertions(+), 1 deletion(-)
--
2.7.4
5 years, 5 months
[libvirt] [PATCH v2] qemu: fix pr-helper0 remain
by Jie Wang
If libvirt receive DISCONNECTED event and set prDaemonRunning to false,
and qemuDomainRemoveDiskDevice is performing in the meantime.
qemuDomainRemoveDiskDevice will return directly by prDaemonRunning
check, so the pr-helper0 object will remain.
In that case we should try harder and also kill the pr-helper process,
so qemuProcessKillManagedPRDaemon could use the same treatment.
Signed-off-by: Jie Wang <wangjie88(a)huawei.com>
---
src/qemu/qemu_hotplug.c | 3 +--
src/qemu/qemu_process.c | 3 ---
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 34249bd..5e4a929 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -465,8 +465,7 @@ qemuHotplugRemoveManagedPR(virQEMUDriverPtr driver,
virErrorPtr orig_err;
int ret = -1;
- if (!priv->prDaemonRunning ||
- virDomainDefHasManagedPR(vm->def))
+ if (virDomainDefHasManagedPR(vm->def))
return 0;
virErrorPreserveLast(&orig_err);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 47d8ca2..8070a09 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2746,9 +2746,6 @@ qemuProcessKillManagedPRDaemon(virDomainObjPtr vm)
virErrorPtr orig_err;
char *pidfile;
- if (!priv->prDaemonRunning)
- return;
-
if (!(pidfile = qemuProcessBuildPRHelperPidfilePath(vm))) {
VIR_WARN("Unable to construct pr-helper pidfile path");
return;
--
2.8.3.windows.1
5 years, 5 months
[libvirt] [PATCH] build: fix linking libqemutestdriver with LTO enabled
by Jim Fehlig
openSUSE Factory is in the process of enabling Link Time Optimization [0]
and stumbled upon missing symbols when linking libqemutestdriver
libtool: link: gcc -shared -fPIC -DPIC ../src/libvirt_qemu_probes.o \
-Wl,--whole-archive ../src/.libs/libvirt_driver_qemu_impl.a \
../src/.libs/libvirt_driver_network_impl.a \
../src/.libs/libvirt_driver_storage_impl.a -Wl,--no-whole-archive \
-lcap-ng -lgnutls -lnl-route-3 -lnl-3 -ldbus-1 -lselinux -lapparmor \
/usr/lib/libxml2.so -ldl -lz -llzma -lm -lblkid -ltirpc \
-fstack-protector-strong -O2 -fstack-protector-strong -flto=16 -g -O2 \
-fstack-protector-strong -flto=16 -g \
-Wl,-soname -Wl,libqemutestdriver.so -o .libs/libqemutestdriver.so
...
/usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `mdir_name'
/usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `rpl_ioctl'
/usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `rpl_pipe2'
/usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `recvfd'
/usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `c_strcasecmp'
The missing symbols are provided by GNUlib. Add it when linking
libqemutestdriver.
[0] https://en.opensuse.org/openSUSE:LTO
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
tests/Makefile.am | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 46d94d2236..1d80647c9f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -557,7 +557,7 @@ endif WITH_DTRACE_PROBES
libqemutestdriver_la_SOURCES =
libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
-libqemutestdriver_la_LIBADD = $(qemu_LDADDS)
+libqemutestdriver_la_LIBADD = $(qemu_LDADDS) $(GNULIB_LIBS)
qemucpumock_la_SOURCES = \
qemucpumock.c testutilshostcpus.h
@@ -729,7 +729,7 @@ lxcconf2xmltest_SOURCES = \
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
else ! WITH_LXC
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
-endif ! WITH_LXC
+-endif ! WITH_LXC
if WITH_OPENVZ
openvzutilstest_SOURCES = \
--
2.21.0
5 years, 5 months