[libvirt] [PATCH] test driver: Fix domain ID after redefining a running VM

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

 



The ID of the existing VM was being unconditionally set to -1, which was
upsetting virt-manager.

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
 src/test.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/test.c b/src/test.c
index 7dc0840..2a672a3 100644
--- a/src/test.c
+++ b/src/test.c
@@ -1623,16 +1623,16 @@ static virDomainPtr testDomainDefineXML(virConnectPtr conn,
                                   def)) == NULL) {
         goto cleanup;
     }
+    def = NULL;
     dom->persistent = 1;
-    dom->def->id = -1;
+
     event = virDomainEventNewFromObj(dom,
                                      VIR_DOMAIN_EVENT_DEFINED,
                                      VIR_DOMAIN_EVENT_DEFINED_ADDED);
 
-    ret = virGetDomain(conn, def->name, def->uuid);
-    def = NULL;
+    ret = virGetDomain(conn, dom->def->name, dom->def->uuid);
     if (ret)
-        ret->id = -1;
+        ret->id = dom->def->id;
 
 cleanup:
     virDomainDefFree(def);
-- 
1.6.0.6

--
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]