[libvirt] [PATCH] 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. --- src/qemu/qemu_process.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f12d7d5..e81e57f 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 is disabled in qemu.conf")); + goto error; + } + if (virPortAllocatorAcquire(driver->remotePorts, &tlsPort) < 0) goto error; -- 1.8.2.1

On 04/29/2013 05:50 AM, Peter Krempa wrote:
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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 04/29/13 18:25, Eric Blake wrote:
On 04/29/2013 05:50 AM, Peter Krempa wrote:
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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
ACK.
Thanks; pushed with a small wording tweak: Auto allocation of spice TLS port requested but spice TLS is disabled in qemu.conf instead of Auto allocation of spice TLS port requested but spice is disabled in qemu.conf Peter
participants (2)
-
Eric Blake
-
Peter Krempa