On Fri, Jul 15, 2016 at 06:30:32PM +0200, Sascha Silbe wrote: > Ever since a041de15 [Update to comply with internal driver API] > changed the code to use virDomain.id instead of _virDomainObj.id > (qemud_vm.id back then) directly, the domain ID retrieved with > virDomainGetID() is incorrect after virDomainCreate() or > virDomainCreateWithFlags() was called. The API consumer has to look up > the domain anew to retrieve the correct ID.
Err no. The src/remote_driver.c remoteDomainCreate method will call virDomainLookupByUUID to fetch the updated id. The dom->id value in the QEMU driver is never used because that virDomainPtr instance only exists for the life of the virDomainCreate API call on the server side and is never seen by the client. > > Copy over the ID in qemuDomainCreateWithFlags() so it's correct for > the existing domain instance, too. > > Fixes: a041de15 ("Update to comply with internal driver API") > Reported-by: Marc Hartmayer <mhart...@linux.vnet.ibm.com> > Signed-off-by: Sascha Silbe <si...@linux.vnet.ibm.com> > Tested-by: Marc Hartmayer <mhart...@linux.vnet.ibm.com> > Reviewed-by: Marc Hartmayer <mhart...@linux.vnet.ibm.com> > --- > src/qemu/qemu_driver.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c > index cda85f6..6929b23 100644 > --- a/src/qemu/qemu_driver.c > +++ b/src/qemu/qemu_driver.c > @@ -7100,6 +7100,7 @@ qemuDomainCreateWithFlags(virDomainPtr dom, unsigned > int flags) > QEMU_ASYNC_JOB_START) < 0) > goto endjob; > > + dom->id = vm->def->id; > ret = 0; > > endjob: > -- 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 :| -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list