[libvirt] [PATCH] qemu: forbid second blockcommit during active commit
by Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=1135339 documents some
confusing behavior when a user tries to start an inactive block
commit in a second connection while there is already an on-going
active commit from a first connection. Eventually, qemu will
support multiple simultaneous block jobs, but as of now, it does
not; furthermore, libvirt also needs an overhaul before we can
support simultaneous jobs. So, the best way to avoid confusing
ourselves is to quit relying on qemu to tell us about the situation
(where we risk getting in weird states) and instead forbid a
duplicate block commit ourselves.
Note that we are still relying on qemu to diagnose attempts to
interrupt an inactive commit (since we only track XML of an active
commit), but as inactive commit is less confusing for libvirt to
manage, there is less that can go wrong by leaving that detection
up to qemu.
* src/qemu/qemu_driver.c (qemuDomainBlockCommit): Hoist check for
active commit to occur earlier outside of conditions.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/qemu/qemu_driver.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index cdf4173..14cbb2b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1,7 +1,7 @@
/*
* qemu_driver.c: core driver methods for managing qemu guests
*
- * Copyright (C) 2006-2014 Red Hat, Inc.
+ * Copyright (C) 2006-2015 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -16237,6 +16237,12 @@ qemuDomainBlockCommit(virDomainPtr dom,
disk->dst);
goto endjob;
}
+ if (disk->mirror) {
+ virReportError(VIR_ERR_BLOCK_COPY_ACTIVE,
+ _("disk '%s' already in active block job"),
+ disk->dst);
+ goto endjob;
+ }
if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0)
goto endjob;
@@ -16261,12 +16267,6 @@ qemuDomainBlockCommit(virDomainPtr dom,
disk->dst);
goto endjob;
}
- if (disk->mirror) {
- virReportError(VIR_ERR_BLOCK_COPY_ACTIVE,
- _("disk '%s' already in active block job"),
- disk->dst);
- goto endjob;
- }
} else if (flags & VIR_DOMAIN_BLOCK_COMMIT_ACTIVE) {
virReportError(VIR_ERR_INVALID_ARG,
_("active commit requested but '%s' is not active"),
--
2.1.0
9 years, 11 months
[libvirt] [PATCH v2 00/11] Add schema validation for domain XML
by Daniel P. Berrange
A followup to
https://www.redhat.com/archives/libvir-list/2014-November/msg00607.html
In this posting
- Finished virsh integration for define, create & edit commands
- Support validation in all virt drivers
- Fix misc bugs in changes to domain_conf flag handling
The situation with libxml error reporting isn't as bad as I
thought. The bad errors mostly just appear when you've added
an unknown XML element. If you add unknown XML attributes
or attribute values the errors reporting are quite reasonable.
Daniel P. Berrange (11):
Add new virDomainDefineXMLFlags public API
Add stub virDomainDefineXMLFlags impls
Add virXMLValidateAgainstSchema helper method
Don't use VIR_DOMAIN_XML_SECURE when parsing XML
Don't pass VIR_DOMAIN_XML_SECURE to virDomainDefParseString in phyp
Fix flags passed to virDomainDefParseString by XenAPI driver
parallels: don't override error message when XML parsing fails
Decouple CPU XML formatting from domain XML public API flags
Give virDomainDef parser & formatter their own flags
Add support for schema validation when passing in XML
virsh: enable domain XML validation by default
include/libvirt/libvirt-domain.h | 9 ++
include/libvirt/virterror.h | 1 +
src/bhyve/bhyve_driver.c | 31 +++-
src/conf/capabilities.c | 2 +-
src/conf/cpu_conf.c | 14 +-
src/conf/cpu_conf.h | 6 +-
src/conf/domain_conf.c | 297 +++++++++++++++++++-------------------
src/conf/domain_conf.h | 34 +++++
src/conf/snapshot_conf.c | 9 +-
src/cpu/cpu.c | 2 +-
src/driver-hypervisor.h | 5 +
src/esx/esx_driver.c | 27 +++-
src/hyperv/hyperv_driver.c | 3 +-
src/internal.h | 4 +
src/libvirt-domain.c | 48 ++++++
src/libvirt_private.syms | 2 +
src/libvirt_public.syms | 5 +
src/libxl/libxl_domain.c | 2 +-
src/libxl/libxl_driver.c | 46 ++++--
src/libxl/libxl_migration.c | 6 +-
src/lxc/lxc_driver.c | 37 +++--
src/openvz/openvz_driver.c | 33 ++++-
src/parallels/parallels_driver.c | 20 ++-
src/phyp/phyp_driver.c | 13 +-
src/qemu/qemu_domain.c | 9 +-
src/qemu/qemu_driver.c | 48 ++++--
src/qemu/qemu_migration.c | 8 +-
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 19 ++-
src/remote_protocol-structs | 8 +
src/security/security_apparmor.c | 2 +-
src/security/virt-aa-helper.c | 3 +-
src/test/test_driver.c | 41 ++++--
src/uml/uml_driver.c | 34 ++++-
src/util/virerror.c | 6 +
src/util/virxml.c | 74 ++++++++++
src/util/virxml.h | 5 +
src/vbox/vbox_common.c | 29 +++-
src/vmware/vmware_driver.c | 29 +++-
src/xen/xen_driver.c | 31 +++-
src/xen/xend_internal.c | 6 +-
src/xen/xm_internal.c | 4 +-
src/xenapi/xenapi_driver.c | 26 +++-
tests/bhyvexml2argvtest.c | 2 +-
tests/bhyvexml2xmltest.c | 4 +-
tests/cpuset | 2 +-
tests/cputest.c | 11 +-
tests/domainsnapshotxml2xmltest.c | 2 +-
tests/lxcxml2xmltest.c | 4 +-
tests/openvzutilstest.c | 2 +-
tests/qemuagenttest.c | 2 +-
tests/qemuhotplugtest.c | 6 +-
tests/qemuxml2argvtest.c | 2 +-
tests/qemuxml2xmltest.c | 9 +-
tests/qemuxmlnstest.c | 2 +-
tests/vmx2xmltest.c | 2 +-
tests/xlconfigtest.c | 7 +-
tests/xmconfigtest.c | 4 +-
tests/xml2sexprtest.c | 2 +-
tests/xml2vmxtest.c | 2 +-
tools/virsh-domain.c | 87 +++++++++--
61 files changed, 851 insertions(+), 340 deletions(-)
--
2.1.0
9 years, 11 months
[libvirt] [PATCHv7 0/4] Introduce API to query IP addresses for given domain
by Nehal J Wani
This feature has been requested for a very long time. Since qemu guest
agent gives us reliable results, now the wait is over.
The RFC was first proposed by Michal Privoznik:
http://www.redhat.com/archives/libvir-list/2012-February/msg00437.html
A patch was submitted, using structs:
https://www.redhat.com/archives/libvir-list/2012-June/msg00220.html
Another patch was submitted, using XML:
https://www.redhat.com/archives/libvir-list/2012-June/msg00904.html
Neither of the patches were accepted, probably due to lack of extensibility
and usability. Hence, we thought of using virTypedParameters for reporting
list of interfaces along with their MAC address and IP addresses. The RFC
can be found here:
https://www.redhat.com/archives/libvir-list/2013-July/msg00084.html
The idea of extensibility was rejected and rendered out of scope of
libvirt. Hence, we were back to structs.
This API is called virDomainInterfaceAddresses which returns a dynamically
allocated array of virDomainInterface struct. The great disadvantage is
once this gets released, it's written in stone and we cannot change
or add an item into it.
The virsh CLI supports two methods:
* Return information (list of all associated interfaces with MAC address
and IP addresses) of all of the domain interfaces by default (if
no interface name is provided)
* Return information for the specified interface (if an interface name
is provided)
v7:
* Enable support for DHCP lease file parsing method
v6:
* Inclusion of flags, readonly check for guest agent connection
* Correction of memory leaks, other small nits.
* https://www.redhat.com/archives/libvir-list/2013-September/msg00350.html
v5:
* s/virDomainInterfacesAddresses/virDomainInterfaceAddresses.
* Case for IP aliasing handled using virHashTable.
* New test cases added, involving multiple and 0 IP addresse(s)
per interface.
* IP prefix changed from int to unsigned int.
* Changes to practice libvirt habits.
* https://www.redhat.com/archives/libvir-list/2013-September/msg00003.html
v4:
* Various style nits, indentation errors, memory leaks fixed.
* https://www.redhat.com/archives/libvir-list/2013-August/msg01265.html
v3:
* Upper bounds to number of interfaces and addresses per interface
introduced.
* Change from array of structs to array of pointers
* ifaces_count moved from function argument to return value
* Changes in variable names
* Test cases added for qemuAgentGetInterfaces.
* https://www.redhat.com/archives/libvir-list/2013-August/msg01215.html
v2:
* Logical errors, memory leaks and few other errors fixed.
* https://www.redhat.com/archives/libvir-list/2013-August/msg00631.html
v1:
* http://www.redhat.com/archives/libvir-list/2013-July/msg01553.html
Nehal J Wani (4):
domifaddr: Implement the public APIs
domifaddr: Implement the remote protocol
domifaddr: Implement the API for qemu
domifaddr: Add virsh support
daemon/remote.c | 134 +++++++++++++++++++++++++
include/libvirt/libvirt-domain.h | 27 +++++
src/driver-hypervisor.h | 5 +
src/libvirt-domain.c | 129 ++++++++++++++++++++++++
src/libvirt_public.syms | 2 +
src/qemu/qemu_agent.c | 202 ++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 4 +
src/qemu/qemu_driver.c | 153 +++++++++++++++++++++++++++++
src/remote/remote_driver.c | 100 +++++++++++++++++++
src/remote/remote_protocol.x | 42 +++++++-
src/remote_protocol-structs | 24 +++++
tests/qemuagenttest.c | 188 +++++++++++++++++++++++++++++++++++
tools/virsh-domain-monitor.c | 141 ++++++++++++++++++++++++++
tools/virsh.pod | 16 +++
14 files changed, 1166 insertions(+), 1 deletion(-)
--
1.7.10.4
9 years, 11 months
[libvirt] [PATCH 0/9] qemu: Add quorum support to libvirt
by Matthias Gatto
The purpose of these patches is to introduce quorum for libvirt
I've try to follow this proposal:
http://www.redhat.com/archives/libvir-list/2014-May/msg00533.html
This feature ask for 6 task:
1) Allow a _virStorageSource
to contain more than one backing store.
Therefore we have to treat the field virStorageSourcePtr backingStores
as an array instead of a pointer.
But doing that, most of the backingStore field would be an array contening
only one element.
So I've decide to allocate the array only if there is more than 1
backing store in a _virStorageSource.
Because all the actual libvirt code use the backingStore field
as a pointer and we needs want to change that, I've decide to encapsulate
the backingStore field to simplifie the array manipulation.
2) Add the missing field a quorum need in _virStorageSource and
the VIR_STORAGE_TYPE_QUORUM and VIR_STORAGE_FILE_QUORUM in
their respectives enums.
3) Parse and format the xml
Because a quorum allows to have more than one backing store at the same level
we need to change virDomainDiskDefFormat and virDomainDiskDefParseXML
to call virDomainDiskBackingStoreFormat and virDomainDiskBackingStoreParse
in a loop.
virDomainDiskBackingStoreFormat and virDomainDiskBackingStoreParse can
call themself recursively in a loop because a quorum can contain another
quorum
4) Add nodename
We need to add nodename support in _virStorageSource because qemu
use them for their child.
5) Build qemu string
As for the xml, we have to call the function which create quorum recursively.
But this task have the problem explained here:
http://www.redhat.com/archives/libvir-list/2014-October/msg00529.html
The _virStorageSource missing some informations that can be passed to
a child, and therefore this version of quorum is incomplet.
6) Allow to hotplug/change a disk in a quorum
This part is not present in these patches because for this task
we have to use blockdev-add, and currently libvirt use
device_add for hotpluging that doesn't allow to hotplug quorum childs.
There is 3 way to handle this problem:
1) create a virDomainBlockDevAdd function in libvirt witch call
blockdev-add.
2) use blockdev-add instead of device_add in qemuMonitorJSONAddDevice
3) write a hack which uses blockdev-add when only attaching quorum
(but i'm pretty sure this solution is not the good one)
Matthias Gatto (9):
virstoragefile: Add virStorageSourceGetBackingStore
virstoragefile: Always use virStorageSourceGetBackingStore to get
backing store
virstoragefile: Add virStorageSourceSetBackingStore
virstoragefile: Always use virStorageSourceSetBackingStore to set
backing store
virstoragefile: Treat backingStore as a pointer or an array
virstoragefile: Add quorum in virstoragefile
domain_conf: Read and Write quorum config
qemu: Add quorum support in qemuBuildDriveDevStr
virstoragefile: Add node-name
src/conf/domain_conf.c | 193 ++++++++++++++++++++++++++--------
src/conf/storage_conf.c | 7 +-
src/libvirt_private.syms | 3 +
src/qemu/qemu_cgroup.c | 4 +-
src/qemu/qemu_command.c | 114 ++++++++++++++++++++
src/qemu/qemu_domain.c | 3 +-
src/qemu/qemu_driver.c | 20 ++--
src/security/security_dac.c | 2 +-
src/security/security_selinux.c | 4 +-
src/security/virt-aa-helper.c | 2 +-
src/storage/storage_backend.c | 12 +--
src/storage/storage_backend_fs.c | 12 +--
src/storage/storage_backend_logical.c | 4 +-
src/storage/storage_driver.c | 2 +-
src/util/virstoragefile.c | 136 +++++++++++++++++++++---
src/util/virstoragefile.h | 12 +++
tests/virstoragetest.c | 18 ++--
17 files changed, 445 insertions(+), 103 deletions(-)
--
1.8.3.1
9 years, 11 months
[libvirt] [PATCH] conf: fix crash when hotplug a channel chr device with no target
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1181408
when we try to hotplug a channel chr device with no target, we
will get success(which should fail) in virDomainChrDefParseXML,
because we use goto cleanup this place and return def.then cause
a big problem in virDomainChrEquals(touch a shouldn't happend place).
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 57e99e6..3cbb93d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8700,7 +8700,7 @@ virDomainChrDefParseXML(xmlXPathContextPtr ctxt,
if (!seenTarget &&
((def->targetType = virDomainChrDefaultTargetType(def->deviceType)) < 0))
- goto cleanup;
+ goto error;
if (virDomainChrSourceDefParseXML(&def->source, node->children, flags, def,
ctxt, vmSeclabels, nvmSeclabels) < 0)
--
1.8.3.1
9 years, 11 months
[libvirt] [PATCH 0/5] parallels: manage container's filesystems
by Dmitry Guryanov
This patch series adds ability to manage container's
filesystems: you can add or remove fs from existing
container or create new one, based on existing
disk image.
Dmitry Guryanov (5):
add ploop fs driver type
parallels: dump info about container filesystems
parallels: commit with PVCF_DETACH_HDD_BUNDLE flag
parallels: allow to add filesystems to container
parallels: create container from existing image
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/parallels/parallels_sdk.c | 209 ++++++++++++++++++++++++++++++++++++++----
src/qemu/qemu_command.c | 1 +
4 files changed, 196 insertions(+), 18 deletions(-)
--
2.1.0
9 years, 11 months
[libvirt] should active block commit ever be allowed to show 0 total progress?
by Eric Blake
I was trying to work on a libvirt bug, when I discovered the following:
$ qemu-img create -f qcow2 a.qcow2 10M
Formatting 'a.qcow2', fmt=qcow2 size=10485760 encryption=off
cluster_size=65536 lazy_refcounts=off
$ qemu-img create -f qcow2 \
-obacking_file=a.qcow2,backing_fmt=qcow2 b.qcow2
Formatting 'b.qcow2', fmt=qcow2 size=10485760 backing_file='a.qcow2'
backing_fmt='qcow2' encryption=off cluster_size=65536 lazy_refcounts=off
$ qemu-img create -f qcow2 \
-obacking_file=b.qcow2,backing_fmt=qcow2 c.qcow2
Formatting 'c.qcow2', fmt=qcow2 size=10485760 backing_file='b.qcow2'
backing_fmt='qcow2' encryption=off cluster_size=65536 lazy_refcounts=off
$ qemu-kvm -nodefaults -qmp stdio c.qcow2
{"execute":"qmp_capabilities"}
{"execute":"block-commit","arguments":{"device":"ide0-hd0","top":"c.qcow2","base":"b.qcow2"}}
Note that it gives me the following event practically right away:
{"timestamp": {"seconds": 1421101221, "microseconds": 47075}, "event":
"BLOCK_JOB_READY", "data": {"device": "ide0-hd0", "len": 0, "offset": 0,
"speed": 0, "type": "commit"}}
and that a "query-block-jobs" confirms the "len":0,"offset":0 reporting.
That is, because c.qcow2 has no sectors that differ from b.qcow2, the
two files are immediately in sync. But what is annoying is that it
claims that 'len' and 'offset' are equal at zero, while libvirt has code
that special cases both numbers as 0 as meaning that the job has not yet
started. I can fix libvirt to treat len==offset==0 as treating a job as
100% complete, but I'm wondering if qemu should be fixed to always
report a non-zero length for every job that has successfully started, in
order to reserve the case of a zero length for a job that has not yet
determined how much needs to be done and can be treated as 0% complete.
That is, does qemu have a bug for making it possible to confuse libvirt
on whether a copy or active commit job has entered the second phase in
contrast to not knowing if the job has started yet?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
9 years, 11 months
[libvirt] [PATCH v2 00/12] qemu: support hot-plug/unplug RNG device
by Luyao Huang
qemu already support hot-plug and hot-unplug RNG device.
These patch will make libvirt support hot-plug/unplug RNG device for qemu driver.
v2:
-remove a commit about add 4 new func in libvirt_private.syms and move them to
the commit which use these functions
-impove some commit subject
-improve the logic in virDomainRNGRemove
-remove qemuDomainRNGInsert
-unexport qemuDomainRNGRemove
-add a check if chardev and backend object ID have the same basic alias name
-rename need_remove to remove_chardev in qemuDomainAttachRNGDevice
-add qemu capability check for RNG device backend
Luyao Huang (12):
qemu: Add helper to assign RNG device aliases
qemu: refactor qemuBuildRNGDeviceArgs to allow reuse in RNG hotplug
conf: Introduce function to compare RNG devices.
conf: add 3 functions for insert,remove and find a RNG device
qemu: add id when build RNG device and rename object id
qemu: add a function to remove a RNG device
qemu: add a functions for attach a rng object in json monitor
qemu: add 2 functions to attach/detach RNG device via qemu monitor
audit: export virDomainAuditRNG
qemu: Implement RNG device hotplug on live level
qemu: Implement RNG device hotunplug on live level
tests: fix tests to suit qemu args changes for RNG devices
src/conf/domain_audit.c | 2 +-
src/conf/domain_audit.h | 7 +
src/conf/domain_conf.c | 76 +++++++
src/conf/domain_conf.h | 9 +
src/libvirt_private.syms | 6 +
src/qemu/qemu_command.c | 69 ++++---
src/qemu/qemu_command.h | 5 +
src/qemu/qemu_driver.c | 12 +-
src/qemu/qemu_hotplug.c | 219 ++++++++++++++++++++-
src/qemu/qemu_hotplug.h | 7 +-
src/qemu/qemu_monitor.c | 43 ++++
src/qemu/qemu_monitor.h | 7 +
src/qemu/qemu_monitor_json.c | 46 +++++
src/qemu/qemu_monitor_json.h | 5 +
.../qemuxml2argv-aarch64-virt-virtio.args | 4 +-
.../qemuxml2argv-arm-vexpressa9-virtio.args | 4 +-
.../qemuxml2argv-arm-virt-virtio.args | 4 +-
.../qemuxml2argv-s390-piix-controllers.args | 2 +-
.../qemuxml2argv-s390-usb-none.args | 2 +-
.../qemuxml2argv-virtio-rng-ccw.args | 4 +-
.../qemuxml2argv-virtio-rng-default.args | 4 +-
.../qemuxml2argv-virtio-rng-egd.args | 4 +-
.../qemuxml2argv-virtio-rng-multiple.args | 8 +-
.../qemuxml2argv-virtio-rng-random.args | 4 +-
24 files changed, 505 insertions(+), 48 deletions(-)
--
1.8.3.1
9 years, 11 months
[libvirt] [PATCH 00/12] Replace Xen xl parsing/formatting impl
by Jim Fehlig
The first attempt to implement support for parsing/formatting Xen's
xl disk config format copied Xen's flex-based parser into libvirt, which
has proved to be challenging in the context of autotools. But as it turns
out, Xen provides an interface to the parser via libxlutil.
This series reverts the first attempt, along with subsequent attempts to
fix it, and replaces it with an implementation based on libxlutil. The
first nine patches revert the original implementation and subsequent fixes.
Patch 10 provides an implemenation based on libxlutil. Patches 11 and
12 are basically unchanged from patches 3 and 4 in the first attempt.
One upshot of using libxlutil instead of copying the flex source is
removing the potential for source divergence.
Jim Fehlig (10):
Revert "bootstrap.conf: add check for flex"
Revert "src/Makefile: Fix parallel build after xen_xl_disk parser
introduction"
Revert "src/Makefile: move the new xen_xl_disk parser code at the
correct place"
Revert "Revert "src/Makefile.am: fix build breaker for xenconfig""
Revert "build: fix xenconfig VPATH builds"
Revert "src/Makefile.am: fix build breaker for xenconfig"
Revert "libxl: Add support for parsing/formating Xen XL config"
Revert "tests: Tests for the xen-xl parser"
Revert "src/xenconfig: Xen-xl parser"
Introduce support for parsing/formatting Xen xl config format
Kiarie Kahurani (2):
tests: Tests for the xen-xl parser
libxl: Add support for parsing/formating Xen XL config
.gitignore | 1 -
bootstrap.conf | 3 +-
cfg.mk | 3 +-
configure.ac | 4 +-
src/Makefile.am | 49 ++-----
src/xenconfig/xen_xl.c | 205 ++++++++++++++--------------
src/xenconfig/xen_xl_disk.l | 256 -----------------------------------
src/xenconfig/xen_xl_disk_i.h | 39 ------
tests/xlconfigdata/test-new-disk.cfg | 2 +-
9 files changed, 114 insertions(+), 448 deletions(-)
delete mode 100644 src/xenconfig/xen_xl_disk.l
delete mode 100644 src/xenconfig/xen_xl_disk_i.h
--
1.8.4.5
9 years, 11 months
[libvirt] [PATCH 1/2] lxc: Move setting ifname_guest_actual to virLXCSetupInterfaces
by Guido Günther
so it applies to interfaces of type 'direct' too.
Reported and patch provided by Bastian Blank at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769600
---
src/lxc/lxc_process.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 1c0d4e5..c3818a5 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -260,8 +260,6 @@ char *virLXCProcessSetupInterfaceBridged(virConnectPtr conn,
if (virNetDevSetMAC(containerVeth, &net->mac) < 0)
goto cleanup;
- if (VIR_STRDUP(net->ifname_guest_actual, containerVeth) < 0)
- goto cleanup;
if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) {
if (virNetDevOpenvswitchAddPort(brname, parentVeth, &net->mac,
@@ -432,6 +430,9 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
(*veths)[(*nveths)-1] = veth;
+ if (VIR_STRDUP(def->nets[i]->ifname_guest_actual, veth) < 0)
+ goto cleanup;
+
/* Make sure all net definitions will have a name in the container */
if (!net->ifname_guest) {
if (virAsprintf(&net->ifname_guest, "eth%zu", niface) < 0)
--
2.1.3
9 years, 11 months