Re: [libvirt] [PATCHv3 1/6] flags: use common dumpxml flags check

2011-07-15 Thread Matthias Bolte
2011/7/15 Eric Blake ebl...@redhat.com:
 The previous patches only cleaned up ATTRIBUTE_UNUSED flags cases;
 auditing the drivers found other places where flags was being used
 but not validated.  In particular, domainGetXMLDesc had issues with
 clients accepting a different set of flags than the common
 virDomainDefFormat helper function.

 * src/conf/domain_conf.c (virDomainDefFormat): Add common flag check.
 * src/storage/storage_driver.c (storageVolumeCreateXMLFrom): Pass
 0 to drivers, since all flags are currently rejected.
 * src/uml/uml_driver.c (umlDomainAttachDeviceFlags)
 (umlDomainDetachDeviceFlags): Reject unknown
 flags.
 * src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc)
 (vboxDomainAttachDeviceFlags)
 (vboxDomainDetachDeviceFlags): Likewise.
 * src/qemu/qemu_driver.c (qemudDomainMemoryPeek): Likewise.
 (qemuDomainGetXMLDesc): Document common flag handling.
 * src/libxl/libxl_driver.c (libxlDomainGetXMLDesc): Likewise.
 * src/lxc/lxc_driver.c (lxcDomainGetXMLDesc): Likewise.
 * src/openvz/openvz_driver.c (openvzDomainGetXMLDesc): Likewise.
 * src/phyp/phyp_driver.c (phypDomainGetXMLDesc): Likewise.
 * src/test/test_driver.c (testDomainGetXMLDesc): Likewise.
 * src/vmware/vmware_driver.c (vmwareDomainGetXMLDesc): Likewise.
 * src/xenapi/xenapi_driver.c (xenapiDomainGetXMLDesc): Likewise.
 ---

 diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
 index 4f35be0..419df42 100644
 --- a/src/storage/storage_driver.c
 +++ b/src/storage/storage_driver.c
 @@ -1522,7 +1522,7 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
         virStoragePoolObjUnlock(origpool);
     }

 -    buildret = backend-buildVolFrom(obj-conn, pool, newvol, origvol, 
 flags);
 +    buildret = backend-buildVolFrom(obj-conn, pool, newvol, origvol, 0);

     storageDriverLock(driver);
     virStoragePoolObjLock(pool);

I don't think that this is a good idea. Even if the function doesn't
have any flags at the moment this change will give us trouble when
someone want's to add a flag to virStorageVolCreateXMLFrom that should
have been passed down to the backend's buildVolFrom function.

ACK, to a patch without this hunk.

-- 
Matthias Bolte
http://photron.blogspot.com

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

Re: [libvirt] [PATCHv3 1/6] flags: use common dumpxml flags check

2011-07-15 Thread Eric Blake
On 07/15/2011 09:25 AM, Matthias Bolte wrote:
 2011/7/15 Eric Blake ebl...@redhat.com:
 The previous patches only cleaned up ATTRIBUTE_UNUSED flags cases;
 auditing the drivers found other places where flags was being used
 but not validated.  In particular, domainGetXMLDesc had issues with
 clients accepting a different set of flags than the common
 virDomainDefFormat helper function.

 * src/conf/domain_conf.c (virDomainDefFormat): Add common flag check.
 * src/storage/storage_driver.c (storageVolumeCreateXMLFrom): Pass
 0 to drivers, since all flags are currently rejected.


 -buildret = backend-buildVolFrom(obj-conn, pool, newvol, origvol, 
 flags);
 +buildret = backend-buildVolFrom(obj-conn, pool, newvol, origvol, 0);

 storageDriverLock(driver);
 virStoragePoolObjLock(pool);
 
 I don't think that this is a good idea. Even if the function doesn't
 have any flags at the moment this change will give us trouble when
 someone want's to add a flag to virStorageVolCreateXMLFrom that should
 have been passed down to the backend's buildVolFrom function.

Fair point, and hunk withdrawn.

 
 ACK, to a patch without this hunk.

Pushed.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
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

Re: [libvirt] [PATCHv3 1/6] flags: use common dumpxml flags check

2011-07-15 Thread Eric Blake
n 07/14/2011 04:42 PM, Eric Blake wrote:
 The previous patches only cleaned up ATTRIBUTE_UNUSED flags cases;
 auditing the drivers found other places where flags was being used
 but not validated.  In particular, domainGetXMLDesc had issues with
 clients accepting a different set of flags than the common
 virDomainDefFormat helper function.
 
 * src/conf/domain_conf.c (virDomainDefFormat): Add common flag check.

Ouch, another regression.  virDomainDefFormat is now causing migration
failure, because virDomainObjFormat (called by virDomainSaveStatus) is
passing an internal-only flag.  I'll have a fix for that shortly.  :(

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
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