[PATCH] qemu: fix domain id after domainCreate(), domainCreateWithFlags()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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 <mhartmay@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Sascha Silbe <silbe@xxxxxxxxxxxxxxxxxx>
Tested-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx>
---
 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:
-- 
1.9.1

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]