mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
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:
parent
562112f4f9
commit
e3dd35e881
@ -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));
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user