]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Add defines for QEMU_VNC_PORT_{MIN,MAX} and use them
authorJim Fehlig <jfehlig@novell.com>
Fri, 21 May 2010 04:25:16 +0000 (22:25 -0600)
committerJim Fehlig <jfehlig@novell.com>
Fri, 21 May 2010 17:29:03 +0000 (11:29 -0600)
src/qemu/qemu_driver.c

index 2f644c974c5e323d13ea3e5f4c5c484d2928f6ae..9837fe253fc43610c841ea0af7a33f0dd74c9a5c 100644 (file)
@@ -88,6 +88,9 @@
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
+#define QEMU_VNC_PORT_MIN  5900
+#define QEMU_VNC_PORT_MAX  65535
+
 /* Only 1 job is allowed at any time
  * A job includes *all* monitor commands, even those just querying
  * information, not merely actions */
@@ -2638,7 +2641,7 @@ qemuInitPCIAddresses(struct qemud_driver *driver,
 static int qemudNextFreeVNCPort(struct qemud_driver *driver ATTRIBUTE_UNUSED) {
     int i;
 
-    for (i = 5900 ; i < 65535 ; i++) {
+    for (i = QEMU_VNC_PORT_MIN; i < QEMU_VNC_PORT_MAX; i++) {
         int fd;
         int reuse = 1;
         struct sockaddr_in addr;