goto cleanup;
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)
goto end_job;
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:
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
}
-/* Returns -2 if not supported with this monitor connection */
int
qemuMonitorSetPassword(qemuMonitorPtr mon,
int type,
return ret;
}
-/* Returns -1 on error, -2 if not supported */
int qemuMonitorJSONSetPassword(qemuMonitorPtr mon,
const char *protocol,
const char *password,
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
goto cleanup;
- if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
- ret = -2;
- goto cleanup;
- }
-
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
goto cleanup;
return ret;
}
-/* Returns -1 on error, -2 if not supported */
int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
const char *protocol,
const char *expire_time)
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
goto cleanup;
- if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
- ret = -2;
- goto cleanup;
- }
-
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
goto cleanup;