]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Assume that 'set_password' and 'expire_password' are supported
authorPeter Krempa <pkrempa@redhat.com>
Tue, 26 Mar 2019 07:14:47 +0000 (08:14 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 26 Mar 2019 13:12:05 +0000 (14:12 +0100)
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>
src/qemu/qemu_hotplug.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_json.c

index c1d2d0001698ed1770925ea3d04b8368942b74db..c7c9a584f298efe6ef9dbdd169aef8252ed19b2d 100644 (file)
@@ -4227,15 +4227,6 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
         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;
 
@@ -4252,17 +4243,6 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
 
     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;
index 0eb7f60e38a8e9e1792c58e45c830b804d5e1af0..d406ecfab30826bccbae5302b1fc56ebe9bbbdd3 100644 (file)
@@ -2395,7 +2395,6 @@ qemuMonitorTypeToProtocol(int type)
 }
 
 
-/* Returns -2 if not supported with this monitor connection */
 int
 qemuMonitorSetPassword(qemuMonitorPtr mon,
                        int type,
index 5c16e1f3a13184bf5f45cd6834e1b0b17f075afd..77c1eaa335489109f6bbeb7693f0a322c47650b5 100644 (file)
@@ -2781,7 +2781,6 @@ int qemuMonitorJSONSetVNCPassword(qemuMonitorPtr mon,
     return ret;
 }
 
-/* Returns -1 on error, -2 if not supported */
 int qemuMonitorJSONSetPassword(qemuMonitorPtr mon,
                                const char *protocol,
                                const char *password,
@@ -2800,11 +2799,6 @@ int qemuMonitorJSONSetPassword(qemuMonitorPtr mon,
     if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
         goto cleanup;
 
-    if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
-        ret = -2;
-        goto cleanup;
-    }
-
     if (qemuMonitorJSONCheckError(cmd, reply) < 0)
         goto cleanup;
 
@@ -2815,7 +2809,6 @@ int qemuMonitorJSONSetPassword(qemuMonitorPtr mon,
     return ret;
 }
 
-/* Returns -1 on error, -2 if not supported */
 int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
                                   const char *protocol,
                                   const char *expire_time)
@@ -2832,11 +2825,6 @@ int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
     if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
         goto cleanup;
 
-    if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
-        ret = -2;
-        goto cleanup;
-    }
-
     if (qemuMonitorJSONCheckError(cmd, reply) < 0)
         goto cleanup;