mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: check defaultMode for spice graphics independently
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>
This commit is contained in:
parent
e4983952b4
commit
a16e5f0a91
@ -4046,24 +4046,25 @@ qemuProcessSPICEAllocatePorts(virQEMUDriverPtr driver,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
|
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
|
||||||
switch (defaultMode) {
|
/* default mode will be used */
|
||||||
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;
|
|
||||||
}
|
|
||||||
break;
|
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) {
|
if (!allocate) {
|
||||||
|
Loading…
Reference in New Issue
Block a user