diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 45d35e9d174347c72345c56872807035c64529e9..bbf6ef5604b7fea78d806ce35483b6377c6d4f4a 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,