[libvirt] [PATCH 4/5] qemu_process: graphics: reserve port only if listen type is address or network

Pavel Hrdina phrdina at redhat.com
Mon Aug 15 11:28:37 UTC 2016


Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 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 d61f704..b3c6400 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4009,6 +4009,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,
-- 
2.9.2




More information about the libvir-list mailing list