[libvirt] [For 1.3.3 0/2] small fixes for recent libxl commits

For 1.3.3: small fixes for recent libxl commits Chunyan noted some problems in commits e6336442 and b5534e53 https://www.redhat.com/archives/libvir-list/2016-March/msg01431.html These two patches fix those issues, essentially making e6336442 and b5534e53 resemble the correct patches originally submitted by Chunyan. See the individual patches for details. With these fixes, Chunyan's patch to "support creating domain with VF assignment from a pool" [0] works fine, save a bug or two in xen-unstable libxl. The patch has been through several revisions and on the list for quite some time. Would it be okay to commit it, along with these patches, for 1.3.3? [0] https://www.redhat.com/archives/libvir-list/2016-March/msg00930.html Jim Fehlig (2): libxl: fix attaching net device of type hostdev libxl: fix net device detach src/libxl/libxl_driver.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.6.1

Chunyan sent a correct patch to fix a resource leak on error in libxlDomainAttachNetDevice https://www.redhat.com/archives/libvir-list/2016-March/msg00924.html I made what was thought to be an improvement and pushed the patch as commit e6336442. As it turns out, my change broke adding net devices that are actually hostdevs to the list of nets in virDomainDef. This patch changes e6336442 to resemble Chunyan's original, correct patch. Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/libxl/libxl_driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 5103495..9955cc7 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -3174,12 +3174,13 @@ libxlDomainAttachNetDevice(libxlDriverPrivatePtr driver, goto cleanup; } - vm->def->nets[vm->def->nnets++] = net; ret = 0; cleanup: libxl_device_nic_dispose(&nic); - if (ret) { + if (!ret) { + vm->def->nets[vm->def->nnets++] = net; + } else { virDomainNetRemoveHostdev(vm->def, net); networkReleaseActualDevice(vm->def, net); } -- 2.6.1

On Wed, Mar 30, 2016 at 04:36:02PM -0600, Jim Fehlig wrote:
Chunyan sent a correct patch to fix a resource leak on error in libxlDomainAttachNetDevice
https://www.redhat.com/archives/libvir-list/2016-March/msg00924.html
I made what was thought to be an improvement and pushed the patch as commit e6336442. As it turns out, my change broke adding net devices that are actually hostdevs to the list of nets in virDomainDef. This patch changes e6336442 to resemble Chunyan's original, correct patch.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/libxl/libxl_driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
ACK Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Chunyan sent a nice cleanup patch for libxlDomainDetachNetDevice https://www.redhat.com/archives/libvir-list/2016-March/msg00926.html which I incorrectly modified before pushing as commit b5534e53. My modification caused network devices of type hostdev to no longer be removed. This patch changes b5534e53 to resemble Chunyan's original, correct patch. Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/libxl/libxl_driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 9955cc7..bf97c9c 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -3449,12 +3449,14 @@ libxlDomainDetachNetDevice(libxlDriverPrivatePtr driver, goto cleanup; } - networkReleaseActualDevice(vm->def, detach); - virDomainNetRemove(vm->def, detachidx); ret = 0; cleanup: libxl_device_nic_dispose(&nic); + if (!ret) { + networkReleaseActualDevice(vm->def, detach); + virDomainNetRemove(vm->def, detachidx); + } virObjectUnref(cfg); return ret; } -- 2.6.1

On Wed, Mar 30, 2016 at 04:36:03PM -0600, Jim Fehlig wrote:
Chunyan sent a nice cleanup patch for libxlDomainDetachNetDevice
https://www.redhat.com/archives/libvir-list/2016-March/msg00926.html
which I incorrectly modified before pushing as commit b5534e53. My modification caused network devices of type hostdev to no longer be removed. This patch changes b5534e53 to resemble Chunyan's original, correct patch.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/libxl/libxl_driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
ACK Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Daniel P. Berrange wrote:
On Wed, Mar 30, 2016 at 04:36:03PM -0600, Jim Fehlig wrote:
Chunyan sent a nice cleanup patch for libxlDomainDetachNetDevice
https://www.redhat.com/archives/libvir-list/2016-March/msg00926.html
which I incorrectly modified before pushing as commit b5534e53. My modification caused network devices of type hostdev to no longer be removed. This patch changes b5534e53 to resemble Chunyan's original, correct patch.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/libxl/libxl_driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
ACK
Thanks. I've pushed both patches. Regards, Jim
participants (2)
-
Daniel P. Berrange
-
Jim Fehlig