From: Pavel Hrdina Date: Sat, 13 Aug 2016 19:29:38 +0000 (+0200) Subject: qemu_process: graphics: setup listen types before ports are reserved/allocated X-Git-Tag: v2.2.0-rc1~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0551b9bc4ec1c379c72dbf3f1ea7daa80b18ba9;p=thirdparty%2Flibvirt.git qemu_process: graphics: setup listen types before ports are reserved/allocated The code that setups listen types may change a listen type from address to socket based on configuration from qemu.conf. This needs to be done before we reserve/allocate ports that won't be used. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1364843 Signed-off-by: Pavel Hrdina --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index bbf6ef5604..907da3045a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4215,6 +4215,13 @@ qemuProcessSetupGraphics(virQEMUDriverPtr driver, size_t i; int ret = -1; + for (i = 0; i < vm->def->ngraphics; i++) { + graphics = vm->def->graphics[i]; + + if (qemuProcessGraphicsSetupListen(driver, graphics, vm) < 0) + goto cleanup; + } + if (allocate) { for (i = 0; i < vm->def->ngraphics; i++) { graphics = vm->def->graphics[i]; @@ -4229,9 +4236,6 @@ qemuProcessSetupGraphics(virQEMUDriverPtr driver, if (qemuProcessGraphicsAllocatePorts(driver, graphics, allocate) < 0) goto cleanup; - - if (qemuProcessGraphicsSetupListen(driver, graphics, vm) < 0) - goto cleanup; } ret = 0;