mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-05 04:41:20 +00:00
qemu: Assume that 'set_password' and 'expire_password' are supported
They were added in qemu commit 7572150c189c6553c2448334116ab717680de66d released in v0.14.0. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a3d179807a
commit
ac5b6cfea8
@ -4227,15 +4227,6 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
ret = qemuMonitorSetPassword(priv->mon, type, password, connected);
|
ret = qemuMonitorSetPassword(priv->mon, type, password, connected);
|
||||||
|
|
||||||
if (ret == -2) {
|
|
||||||
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("Graphics password only supported for VNC"));
|
|
||||||
ret = -1;
|
|
||||||
} else {
|
|
||||||
ret = qemuMonitorSetVNCPassword(priv->mon, password);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
goto end_job;
|
goto end_job;
|
||||||
|
|
||||||
@ -4252,17 +4243,6 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
ret = qemuMonitorExpirePassword(priv->mon, type, expire);
|
ret = qemuMonitorExpirePassword(priv->mon, type, expire);
|
||||||
|
|
||||||
if (ret == -2) {
|
|
||||||
/* XXX we could fake this with a timer */
|
|
||||||
if (auth->expires) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("Expiry of passwords is not supported"));
|
|
||||||
ret = -1;
|
|
||||||
} else {
|
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
end_job:
|
end_job:
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
@ -2395,7 +2395,6 @@ qemuMonitorTypeToProtocol(int type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Returns -2 if not supported with this monitor connection */
|
|
||||||
int
|
int
|
||||||
qemuMonitorSetPassword(qemuMonitorPtr mon,
|
qemuMonitorSetPassword(qemuMonitorPtr mon,
|
||||||
int type,
|
int type,
|
||||||
|
@ -2781,7 +2781,6 @@ int qemuMonitorJSONSetVNCPassword(qemuMonitorPtr mon,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns -1 on error, -2 if not supported */
|
|
||||||
int qemuMonitorJSONSetPassword(qemuMonitorPtr mon,
|
int qemuMonitorJSONSetPassword(qemuMonitorPtr mon,
|
||||||
const char *protocol,
|
const char *protocol,
|
||||||
const char *password,
|
const char *password,
|
||||||
@ -2800,11 +2799,6 @@ int qemuMonitorJSONSetPassword(qemuMonitorPtr mon,
|
|||||||
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
|
|
||||||
ret = -2;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
|
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -2815,7 +2809,6 @@ int qemuMonitorJSONSetPassword(qemuMonitorPtr mon,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns -1 on error, -2 if not supported */
|
|
||||||
int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
|
int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
|
||||||
const char *protocol,
|
const char *protocol,
|
||||||
const char *expire_time)
|
const char *expire_time)
|
||||||
@ -2832,11 +2825,6 @@ int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
|
|||||||
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
|
|
||||||
ret = -2;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
|
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user