Commit 377d74c9 authored by Guido Trotter's avatar Guido Trotter
Browse files

s/HT_HVM_VNC_BASE_PORT/VNC_BASE_PORT/g

The VNC base port has nothing to do with HVM itself, and is general to
VNC itself, so we're removing the HT_HVM prefix to the constant.

Reviewed-by: iustinp
parent 024e157f
......@@ -333,7 +333,7 @@ HYPER_TYPES = frozenset([HT_XEN_PVM, HT_FAKE, HT_XEN_HVM, HT_KVM])
HTS_REQ_PORT = frozenset([HT_XEN_HVM, HT_KVM])
HTS_USE_VNC = frozenset([HT_XEN_HVM, HT_KVM])
HT_HVM_VNC_BASE_PORT = 5900
VNC_BASE_PORT = 5900
VNC_PASSWORD_FILE = _autoconf.SYSCONFDIR + "/ganeti/vnc-cluster-password"
VNC_DEFAULT_BIND_ADDRESS = '0.0.0.0'
......
......@@ -280,8 +280,8 @@ class KVMHypervisor(hv_base.BaseHypervisor):
if vnc_bind_address:
kvm_cmd.extend(['-usbdevice', 'tablet'])
if utils.IsValidIP(vnc_bind_address):
if instance.network_port > constants.HT_HVM_VNC_BASE_PORT:
display = instance.network_port - constants.HT_HVM_VNC_BASE_PORT
if instance.network_port > constants.VNC_BASE_PORT:
display = instance.network_port - constants.VNC_BASE_PORT
if vnc_bind_address == '0.0.0.0':
vnc_arg = ':%d' % (display)
else:
......@@ -290,7 +290,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
logging.error("Network port is not a valid VNC display (%d < %d)."
" Not starting VNC" %
(instance.network_port,
constants.HT_HVM_VNC_BASE_PORT))
constants.VNC_BASE_PORT))
vnc_arg = 'none'
# Only allow tls and other option when not binding to a file, for now.
......@@ -666,8 +666,8 @@ class KVMHypervisor(hv_base.BaseHypervisor):
vnc_bind_address = hvparams[constants.HV_VNC_BIND_ADDRESS]
if vnc_bind_address:
if instance.network_port > constants.HT_HVM_VNC_BASE_PORT:
display = instance.network_port - constants.HT_HVM_VNC_BASE_PORT
if instance.network_port > constants.VNC_BASE_PORT:
display = instance.network_port - constants.VNC_BASE_PORT
vnc_command = ("echo 'Instance has VNC listening on %s:%d"
" (display: %d)'" % (vnc_bind_address,
instance.network_port,
......
......@@ -593,8 +593,8 @@ class XenHvmHypervisor(XenHypervisor):
config.write("vnclisten = '%s'\n" %
instance.hvparams["vnc_bind_address"])
if instance.network_port > constants.HT_HVM_VNC_BASE_PORT:
display = instance.network_port - constants.HT_HVM_VNC_BASE_PORT
if instance.network_port > constants.VNC_BASE_PORT:
display = instance.network_port - constants.VNC_BASE_PORT
config.write("vncdisplay = %s\n" % display)
config.write("vncunused = 0\n")
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment