]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Don't emit tls-port spice option if port is -1
authorJiri Denemark <jdenemar@redhat.com>
Tue, 28 Feb 2012 12:44:08 +0000 (13:44 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 29 Feb 2012 10:12:54 +0000 (11:12 +0100)
Bug introduced by commit eda0fc7a.

src/qemu/qemu_command.c

index 01adf0d9f849d8d9f70c59cfcf1539c398c77002..5e0ca95286b5fcdfd7cdffcdc0a3cc20cf805a6f 100644 (file)
@@ -5345,13 +5345,16 @@ qemuBuildCommandLine(virConnectPtr conn,
 
         virBufferAsprintf(&opt, "port=%u", def->graphics[0]->data.spice.port);
 
-        if (def->graphics[0]->data.spice.tlsPort != -1)
+        if (def->graphics[0]->data.spice.tlsPort != -1) {
             if (!driver->spiceTLS) {
                 qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                                _("spice TLS port set in XML configuration, but TLS is disabled in qemu.conf"));
+                                _("spice TLS port set in XML configuration,"
+                                  " but TLS is disabled in qemu.conf"));
                 goto error;
             }
-            virBufferAsprintf(&opt, ",tls-port=%u", def->graphics[0]->data.spice.tlsPort);
+            virBufferAsprintf(&opt, ",tls-port=%u",
+                              def->graphics[0]->data.spice.tlsPort);
+        }
 
         switch (virDomainGraphicsListenGetType(def->graphics[0], 0)) {
         case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS: