]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
sanlock: Forbid VIR_DOMAIN_LOCK_FAILURE_RESTART
authorJiri Denemark <jdenemar@redhat.com>
Mon, 24 Mar 2014 13:23:09 +0000 (14:23 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 25 Mar 2014 08:08:39 +0000 (09:08 +0100)
https://bugzilla.redhat.com/show_bug.cgi?id=905282
https://bugzilla.redhat.com/show_bug.cgi?id=967494

When lock failure is detected by sanlock, our sanlock_helper kill script
will try to restart (shutdown followed by start) the affected domain
when RESTART action is configured for it. While shutting down kills QEMU
and removes all its leases (which is what sanlock wants to happen),
trying to start it again just hangs because libvirt tries reacquire the
locks in the failed lock space. Hence, this action cannot be supported
by sanlock driver.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/locking/lock_driver_sanlock.c
src/locking/sanlock_helper.c

index b8c86fcd732efc3eb7e8ccc1f00223710960ab53..624691f25a11cf0bbfa53bdd5541baa53bf9bd96 100644 (file)
@@ -786,10 +786,10 @@ virLockManagerSanlockRegisterKillscript(int sock,
         return 0;
 
     case VIR_DOMAIN_LOCK_FAILURE_POWEROFF:
-    case VIR_DOMAIN_LOCK_FAILURE_RESTART:
     case VIR_DOMAIN_LOCK_FAILURE_PAUSE:
         break;
 
+    case VIR_DOMAIN_LOCK_FAILURE_RESTART:
     case VIR_DOMAIN_LOCK_FAILURE_IGNORE:
     case VIR_DOMAIN_LOCK_FAILURE_LAST:
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
index c913cc3f6481ef6647ff08ed3e1de8996af03b1c..08102ebcd7226c63cae08bd2d19bb89373caddb3 100644 (file)
@@ -91,33 +91,13 @@ main(int argc, char **argv)
             ret = EXIT_SUCCESS;
         break;
 
-    case VIR_DOMAIN_LOCK_FAILURE_RESTART:
-        if (virDomainIsPersistent(dom)) {
-            if ((virDomainDestroy(dom) == 0 ||
-                 virDomainIsActive(dom) == 0) &&
-                virDomainCreate(dom) == 0)
-                ret = EXIT_SUCCESS;
-        } else {
-            xml = virDomainGetXMLDesc(dom,
-                                      VIR_DOMAIN_XML_SECURE |
-                                      VIR_DOMAIN_XML_INACTIVE);
-
-            if (!xml ||
-                (virDomainDestroy(dom) < 0 &&
-                 virDomainIsActive(dom) != 0))
-                goto cleanup;
-            virDomainFree(dom);
-            if ((dom = virDomainCreateXML(conn, xml, 0)))
-                ret = EXIT_SUCCESS;
-        }
-        break;
-
     case VIR_DOMAIN_LOCK_FAILURE_PAUSE:
         if (virDomainSuspend(dom) == 0)
             ret = EXIT_SUCCESS;
         break;
 
     case VIR_DOMAIN_LOCK_FAILURE_DEFAULT:
+    case VIR_DOMAIN_LOCK_FAILURE_RESTART:
     case VIR_DOMAIN_LOCK_FAILURE_IGNORE:
     case VIR_DOMAIN_LOCK_FAILURE_LAST:
         fprintf(stderr, _("unsupported failure action: '%s'\n"),