]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Error out if spice port autoallocation is requested, but disabled
authorPeter Krempa <pkrempa@redhat.com>
Mon, 29 Apr 2013 11:41:27 +0000 (13:41 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 30 Apr 2013 07:43:12 +0000 (09:43 +0200)
When a user requests auto-allocation of the spice TLS port but spice TLS
is disabled in qemu.conf, we start the machine and let qemu fail instead
of erroring out sooner.

Add an error message so that this doesn't happen.

src/qemu/qemu_process.c

index f12d7d5b2d5e14ac2ee507d9ba760ae51044e15f..e75c8c9bdf4a981d528c9d1e92c6da84067e43f5 100644 (file)
@@ -3292,8 +3292,14 @@ qemuProcessSPICEAllocatePorts(virQEMUDriverPtr driver,
         graphics->data.spice.port = port;
     }
 
-    if (cfg->spiceTLS &&
-        (needTLSPort || graphics->data.spice.tlsPort == -1)) {
+    if (needTLSPort || graphics->data.spice.tlsPort == -1) {
+        if (!cfg->spiceTLS) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("Auto allocation of spice TLS port requested "
+                             "but spice TLS is disabled in qemu.conf"));
+            goto error;
+        }
+
         if (virPortAllocatorAcquire(driver->remotePorts, &tlsPort) < 0)
             goto error;