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

Nobuhiro Itou fj0873gn at aa.jp.fujitsu.com
Wed Feb 28 05:47:36 UTC 2007


Hi, Dan

Would you give me a comment on this patch?
If not, please apply it.

I think virt-install should check the VNC port number that the user cannot specify.

> 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.101.0)
===================================================================
--- Guest.py    2007-02-28 23:18:37.000000000 +0900
+++ Guest.py.vncport_check      2007-02-28 14:15:49.000000000 +0900
@@ -179,7 +179,9 @@ class XenGraphics(VirtualGraphics):
 class VNCVirtualGraphics(XenGraphics):
     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