]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Revert "xen: Allow to undefine a running domain (xm_internal)"
authorEric Blake <eblake@redhat.com>
Fri, 19 Aug 2011 14:19:34 +0000 (08:19 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 19 Aug 2011 14:19:34 +0000 (08:19 -0600)
ACK was given too soon.  According to the code, the xm driver is
only used for inactive domains, and has no notion of an active
domain, thus, it cannot support undefine of a running domain.
The real fix for xen needs to be in the unified driver and/or
the xend level.

This reverts commit 49186deda62161599877b0de6f7f4345c50d842a.

src/xen/xm_internal.c

index 5c8a017757b03d045924bcfe8ebeac4b2e74a443..95387c9229d34108b8cde50c1c8c497761e0c38e 100644 (file)
@@ -1218,6 +1218,8 @@ int xenXMDomainUndefine(virDomainPtr domain) {
         return (-1);
     }
 
+    if (domain->id != -1)
+        return (-1);
     if (domain->conn->flags & VIR_CONNECT_RO)
         return (-1);
 
@@ -1233,17 +1235,13 @@ int xenXMDomainUndefine(virDomainPtr domain) {
     if (unlink(entry->filename) < 0)
         goto cleanup;
 
-    if (virDomainObjIsActive(vm)) {
-        vm->persistent = 0;
-    } else {
-        /* Remove the name -> filename mapping */
-        if (virHashRemoveEntry(priv->nameConfigMap, domain->name) < 0)
-            goto cleanup;
+    /* Remove the name -> filename mapping */
+    if (virHashRemoveEntry(priv->nameConfigMap, domain->name) < 0)
+        goto cleanup;
 
-        /* Remove the config record itself */
-        if (virHashRemoveEntry(priv->configCache, entry->filename) < 0)
-            goto cleanup;
-    }
+    /* Remove the config record itself */
+    if (virHashRemoveEntry(priv->configCache, entry->filename) < 0)
+        goto cleanup;
 
     ret = 0;