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

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

 



On 08/19/2011 08:03 AM, Osier Yang wrote:
---
  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;

Spoke too soon.  This doesn't compile.  I'll be pushing this.

diff --git i/src/test/test_driver.c w/src/test/test_driver.c
index 422486e..ec2bd75 100644
--- i/src/test/test_driver.c
+++ w/src/test/test_driver.c
@@ -2604,8 +2604,8 @@ static int testDomainUndefineFlags(virDomainPtr domain,
     event = virDomainEventNewFromObj(privdom,
                                      VIR_DOMAIN_EVENT_UNDEFINED,
                                      VIR_DOMAIN_EVENT_UNDEFINED_REMOVED);
-    if (virDomainObjIsActive(vm)) {
-        vm->persistent = 0;
+    if (virDomainObjIsActive(privdom)) {
+        privdom->persistent = 0;
     } else {
         virDomainRemoveInactive(&privconn->domains,
                                 privdom);


--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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