On Tue, Jun 18, 2013 at 04:05:53PM +0200, Jiri Denemark wrote: > --- > src/qemu/qemu_driver.c | 350 +++++++++++++++++++++++++++++++++++++++------- > src/qemu/qemu_migration.c | 162 +++++++++++++++------ > src/qemu/qemu_migration.h | 9 ++ > 3 files changed, 431 insertions(+), 90 deletions(-) > > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c > index a682e36..c040287 100644 > --- a/src/qemu/qemu_driver.c > +++ b/src/qemu/qemu_driver.c > @@ -1086,6 +1086,7 @@ qemuConnectSupportsFeature(virConnectPtr conn ATTRIBUTE_UNUSED, int feature) > case VIR_DRV_FEATURE_TYPED_PARAM_STRING: > case VIR_DRV_FEATURE_XML_MIGRATABLE: > case VIR_DRV_FEATURE_MIGRATION_OFFLINE: > + case VIR_DRV_FEATURE_MIGRATION_PARAMS: > return 1; > default: > return 0; > @@ -9887,21 +9888,18 @@ cleanup: > *******************************************************************/ > > static char * > -qemuDomainMigrateBegin3(virDomainPtr domain, > - const char *xmlin, > - char **cookieout, > - int *cookieoutlen, > - unsigned long flags, > - const char *dname, > - unsigned long resource ATTRIBUTE_UNUSED) > +qemuDomainMigrateBegin3Internal(virDomainPtr domain, > + const char *xmlin, > + const char *dname, > + char **cookieout, > + int *cookieoutlen, > + unsigned long flags) > { > virQEMUDriverPtr driver = domain->conn->privateData; > virDomainObjPtr vm; > char *xml = NULL; > enum qemuDomainAsyncJob asyncJob; > > - virCheckFlags(QEMU_MIGRATION_FLAGS, NULL); > - > if (!(vm = qemuDomObjFromDomain(domain))) > return NULL; > > @@ -9969,26 +9967,66 @@ endjob: > goto cleanup; > } > > +static char * > +qemuDomainMigrateBegin3(virDomainPtr domain, > + const char *xmlin, > + char **cookieout, > + int *cookieoutlen, > + unsigned long flags, > + const char *dname, > + unsigned long resource ATTRIBUTE_UNUSED) > +{ > + virCheckFlags(QEMU_MIGRATION_FLAGS, NULL); > + > + return qemuDomainMigrateBegin3Internal(domain, xmlin, dname, > + cookieout, cookieoutlen, flags); > +} > + > +static char * > +qemuDomainMigrateBegin3Params(virDomainPtr domain, > + virTypedParameterPtr params, > + int nparams, > + char **cookieout, > + int *cookieoutlen, > + unsigned int flags) > +{ > + const char *xmlin = NULL; > + const char *dname = NULL; > + > + virCheckFlags(QEMU_MIGRATION_FLAGS, NULL); > + if (virTypedParamsValidate(params, nparams, QEMU_MIGRATION_PARAMETERS) < 0) > + return NULL; > + > + if (virTypedParamsGetString(params, nparams, > + VIR_MIGRATE_PARAM_DEST_XML, > + &xmlin) < 0 || > + virTypedParamsGetString(params, nparams, > + VIR_MIGRATE_PARAM_DEST_NAME, > + &dname) < 0) > + return NULL; > + > + return qemuDomainMigrateBegin3Internal(domain, xmlin, dname, > + cookieout, cookieoutlen, flags); > +} This change isn't going to fly with the access control check requirements. We mandate that the conversion from virDomainPtr to virDomainDefPtr must always happen in the method that is registered in the driver table. ie you must call qemuDomObjFromDomain() directly from qemuDomainMigrateBegin3 and qemuDomainMigrateBegin3Params and then pass the 'def' into qemuDomainMigrateBegin3Internal Likewise for all the other methods you change in a similar way here. The test suite for the access control code will fail with your patch as it is. 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 :| -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list