[et-mgmt-tools] [PATCH] check the VNC port number

Nobuhiro Itou fj0873gn at aa.jp.fujitsu.com
Fri Feb 23 06:03:34 UTC 2007


Hi,

When I execute "virt-install --vnc --vncport=5900", domain starts 
with 5900 + domain ID.
I think that it is necessary to check, because we cannot appoint 
the VNC port number equal to or less than 5900.

The attached patch adds to check the VNC port number.

Signed-off-by: Nobuhiro Itou <fj0873gn at aa.jp.fujitsu.com>

Thanks,
Nobuhiro Itou.

Index: virtinst/Guest.py (python-virtinst-0.100.0)
===================================================================
--- Guest.py	2007-02-23 02:28:02.000000000 +0900
+++ Guest.py.vncport_check	2007-02-23 02:24:07.000000000 +0900
@@ -157,7 +157,9 @@ class VirtualGraphics:
 class VNCVirtualGraphics(VirtualGraphics):
     def __init__(self, *args):
         self.name = "vnc"
-        if len(args) >= 1 and args[0]:
+        if len(args) >= 1 and not args[0] is None:
+            if args[0] < 5901:
+                raise ValueError, "Invalid value for vncport, vncport must be no less than 5901"
             self.port = args[0]
         else:
             self.port = -1




More information about the et-mgmt-tools mailing list