[libvirt] [PATCH] qemu: only release SPICE TLS port if it has been allocated

Ján Tomko jtomko at redhat.com
Fri Feb 22 15:55:02 UTC 2013


Silence the error message that happens during shutdown of a domain with
spice graphics, autoport enabled if spice_tls is disabled in qemu.conf:

error : virPortAllocatorRelease:174 : port 0 must be in range (5900, 65534)
---
 src/qemu/qemu_process.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b560d2e..1e2bcae 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4321,8 +4321,10 @@ retry:
             graphics->data.spice.autoport) {
             ignore_value(virPortAllocatorRelease(driver->remotePorts,
                                                  graphics->data.spice.port));
-            ignore_value(virPortAllocatorRelease(driver->remotePorts,
-                                                 graphics->data.spice.tlsPort));
+            if (cfg->spiceTLS) {
+                ignore_value(virPortAllocatorRelease(driver->remotePorts,
+                                                     graphics->data.spice.tlsPort));
+            }
         }
     }
 
-- 
1.7.12.4




More information about the libvir-list mailing list