]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: check defaultMode for spice graphics independently
authorPavel Hrdina <phrdina@redhat.com>
Fri, 27 Feb 2015 14:07:03 +0000 (15:07 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 3 Mar 2015 10:42:33 +0000 (11:42 +0100)
Instead of checking defaultMode for every channel that has no mode
configured, test it only once outside of channel loop.  This fixes a bug
that in case all possible channels are fore example set to insecure, but
defaultMode is set to secure, we wouldn't auto-generate TLS port.  This
results in failure while starting a guest.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1143832

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_process.c

index 432249794777a1e82c921a56905279681578cffd..c433e0623f447b8c37b839714d272940f0374a53 100644 (file)
@@ -4046,24 +4046,25 @@ qemuProcessSPICEAllocatePorts(virQEMUDriverPtr driver,
                 break;
 
             case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
-                switch (defaultMode) {
-                case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
-                    needTLSPort = true;
-                    break;
-
-                case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
-                    needPort = true;
-                    break;
-
-                case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
-                    if (cfg->spiceTLS)
-                        needTLSPort = true;
-                    needPort = true;
-                    break;
-                }
+                /* default mode will be used */
                 break;
             }
         }
+        switch (defaultMode) {
+        case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
+            needTLSPort = true;
+            break;
+
+        case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
+            needPort = true;
+            break;
+
+        case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
+            if (cfg->spiceTLS)
+                needTLSPort = true;
+            needPort = true;
+            break;
+        }
     }
 
     if (!allocate) {