提交 e3dd35e8 编写于 作者: J Jiri Denemark

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: NJiri Denemark <jdenemar@redhat.com>
上级 562112f4
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册