From e871ab8862e48485c46177dcfd95da8f945908ae Mon Sep 17 00:00:00 2001 From: Jincheng Miao Date: Fri, 27 Jun 2014 22:37:02 +0800 Subject: [PATCH] qemu: fix domxml-to-native failing when spice_tls is not enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The default graphics channel mode is 'any', so as to defaultMode attribute. If defaultMode and channel mode are all the default value 'any', qemuConnectDomainXMLToNative will set TLSPort. But in qemuBuildGraphicsSPICECommandLine, if spice_tls is not enabled, libvirtd will report an error to tell the user that spice TLS is disabled in qemu.conf. So qemuConnectDomainXMLToNative should check spice_tls is enabled, then decide to allocate an tlsPort number to this graphics. If user specified defaultMode is 'secure', qemuConnectDomainXMLToNative could allocate tlsPort, and then let qemuBuildGraphicsSPICECommandLine reports the spice_tls disabled error. The related bug is: https://bugzilla.redhat.com/show_bug.cgi?id=1113868 Signed-off-by: Jincheng Miao Signed-off-by: Ján Tomko --- src/qemu/qemu_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0a9d0408b0..ecccf6ca09 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6015,7 +6015,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, break; case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY: - needTLSPort = true; + if (cfg->spiceTLS) + needTLSPort = true; needPort = true; break; } -- 2.47.2