From: Peter Krempa Date: Mon, 29 Apr 2013 11:41:27 +0000 (+0200) Subject: qemu: Error out if spice port autoallocation is requested, but disabled X-Git-Tag: v1.0.5~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eca3fdf;p=thirdparty%2Flibvirt.git qemu: Error out if spice port autoallocation is requested, but disabled 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. --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f12d7d5b2d..e75c8c9bdf 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -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;