[PATCH 5/8] test: Allow to undefine a running domain

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

 



---
 src/test/test_driver.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index fb14b10..422486e 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -2601,18 +2601,17 @@ static int testDomainUndefineFlags(virDomainPtr domain,
         goto cleanup;
     }
 
-    if (virDomainObjGetState(privdom, NULL) != VIR_DOMAIN_SHUTOFF) {
-        testError(VIR_ERR_INTERNAL_ERROR,
-                  _("Domain '%s' is still running"), domain->name);
-        goto cleanup;
-    }
-
     event = virDomainEventNewFromObj(privdom,
                                      VIR_DOMAIN_EVENT_UNDEFINED,
                                      VIR_DOMAIN_EVENT_UNDEFINED_REMOVED);
-    virDomainRemoveInactive(&privconn->domains,
-                            privdom);
-    privdom = NULL;
+    if (virDomainObjIsActive(vm)) {
+        vm->persistent = 0;
+    } else {
+        virDomainRemoveInactive(&privconn->domains,
+                                privdom);
+        privdom = NULL;
+    }
+
     ret = 0;
 
 cleanup:
-- 
1.7.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]