Re: [libvirt] [PATCH] libxl: eliminate memory leak in libxmlDomainModifyDeviceFlags

2012-02-28 Thread Laine Stump
On 02/27/2012 01:11 PM, Eric Blake wrote:
 On 02/27/2012 04:01 AM, Laine Stump wrote:
 I found this randomly by examination when a tag search led me to this
 file. I don't have a setup to test it, but it appears fairly obvious
 that this call to virDomainDeviceDefParse is both unnecessary (since
 it will again be called at the top of the immediately following if(),
 and if not there, then at the top of the if following that), but it
 also creates a leak of one virDomainDeviceDef and one [whatever type
 of device the DeviceDef is pointing to; probably a virDomainDiskDef]
 in the case that the function has been called with
 VIR_DOMAIN_DEVICE_MODIFY_CONFIG (the second parse will overwrite the
 devicedef that was just created).
 ---
  src/libxl/libxl_driver.c |4 
  1 files changed, 0 insertions(+), 4 deletions(-)
 ACK.

Pushed. Thanks!

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] libxl: eliminate memory leak in libxmlDomainModifyDeviceFlags

2012-02-27 Thread Laine Stump
I found this randomly by examination when a tag search led me to this
file. I don't have a setup to test it, but it appears fairly obvious
that this call to virDomainDeviceDefParse is both unnecessary (since
it will again be called at the top of the immediately following if(),
and if not there, then at the top of the if following that), but it
also creates a leak of one virDomainDeviceDef and one [whatever type
of device the DeviceDef is pointing to; probably a virDomainDiskDef]
in the case that the function has been called with
VIR_DOMAIN_DEVICE_MODIFY_CONFIG (the second parse will overwrite the
devicedef that was just created).
---
 src/libxl/libxl_driver.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 6db33c2..d5fa64a 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3243,10 +3243,6 @@ libxlDomainModifyDeviceFlags(virDomainPtr dom, const 
char *xml,
  goto cleanup;
 }
 
-if (!(dev = virDomainDeviceDefParse(driver-caps, vm-def, xml,
-  VIR_DOMAIN_XML_INACTIVE)))
-goto cleanup;
-
 priv = vm-privateData;
 
 if (flags  VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
-- 
1.7.7.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] libxl: eliminate memory leak in libxmlDomainModifyDeviceFlags

2012-02-27 Thread Eric Blake
On 02/27/2012 04:01 AM, Laine Stump wrote:
 I found this randomly by examination when a tag search led me to this
 file. I don't have a setup to test it, but it appears fairly obvious
 that this call to virDomainDeviceDefParse is both unnecessary (since
 it will again be called at the top of the immediately following if(),
 and if not there, then at the top of the if following that), but it
 also creates a leak of one virDomainDeviceDef and one [whatever type
 of device the DeviceDef is pointing to; probably a virDomainDiskDef]
 in the case that the function has been called with
 VIR_DOMAIN_DEVICE_MODIFY_CONFIG (the second parse will overwrite the
 devicedef that was just created).
 ---
  src/libxl/libxl_driver.c |4 
  1 files changed, 0 insertions(+), 4 deletions(-)

ACK.

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list