From be51dcb8524146ad93b31856fb3a06be863dde00 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Sat, 13 Aug 2016 21:03:15 +0200 Subject: [PATCH] qemu_process: graphics: reserve port only if listen type is address or network Ports are valid only for listen types 'address' and 'network', other listen types doesn't use them so we should not try to reserve any ports. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_process.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 45d35e9d17..bbf6ef5604 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4011,6 +4011,17 @@ static int qemuProcessGraphicsReservePorts(virQEMUDriverPtr driver, virDomainGraphicsDefPtr graphics) { + virDomainGraphicsListenDefPtr glisten; + + if (graphics->nListens <= 0) + return 0; + + glisten = &graphics->listens[0]; + + if (glisten->type != VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS && + glisten->type != VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK) + return 0; + if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC && !graphics->data.vnc.autoport) { if (virPortAllocatorSetUsed(driver->remotePorts, -- GitLab