sanlock: Forbid VIR_DOMAIN_LOCK_FAILURE_IGNORE

https://bugzilla.redhat.com/show_bug.cgi?id=905280
https://bugzilla.redhat.com/show_bug.cgi?id=967493

Sanlock expects that the configured kill script either kills the PID on
lock failure or removes all locks the PID owns. If none of the two
options happen, sanlock will reboot the host. Although IGNORE action is
supposed to ignore the request to kill the PID or remove all leases,
it's certainly not designed to cause the host to be rebooted. That said,
IGNORE action is incompatible with sanlock and should be forbidden by
libvirt.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2014-03-24 14:22:36 +01:00
parent 562112f4f9
commit e3dd35e881
2 changed files with 13 additions and 5 deletions

View File

@ -781,7 +781,17 @@ virLockManagerSanlockRegisterKillscript(int sock,
int ret = -1;
int rv;
if (action > VIR_DOMAIN_LOCK_FAILURE_IGNORE) {
switch (action) {
case VIR_DOMAIN_LOCK_FAILURE_DEFAULT:
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_IGNORE:
case VIR_DOMAIN_LOCK_FAILURE_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Failure action %s is not supported by sanlock"),
virDomainLockFailureTypeToString(action));

View File

@ -117,11 +117,9 @@ main(int argc, char **argv)
ret = EXIT_SUCCESS;
break;
case VIR_DOMAIN_LOCK_FAILURE_DEFAULT:
case VIR_DOMAIN_LOCK_FAILURE_IGNORE:
ret = EXIT_SUCCESS;
break;
default:
case VIR_DOMAIN_LOCK_FAILURE_LAST:
fprintf(stderr, _("unsupported failure action: '%s'\n"),
virDomainLockFailureTypeToString(action));
break;