Commit 8470c8db authored by Guido Trotter's avatar Guido Trotter
Browse files

KVM: enable VNC if a VNC_BIND_ADDRESS is defined

We'll also enable a tablet usb device, as suggested by the kvm man page.

Reviewed-by: iustinp
parent 56fee73b
......@@ -255,11 +255,25 @@ class KVMHypervisor(hv_base.BaseHypervisor):
# FIXME: handle vnc, if needed
# How do we decide whether to have it or not?? :(
# FIXME: handle vnc password
vnc_bind_address = instance.hvparams[constants.HV_VNC_BIND_ADDRESS]
if vnc_bind_address:
kvm_cmd.extend(['-usbdevice', 'tablet'])
if instance.network_port > constants.HT_HVM_VNC_BASE_PORT:
display = instance.network_port - constants.HT_HVM_VNC_BASE_PORT
if vnc_bind_address == '':
vnc_arg = ':%d' % (display)
vnc_arg = '%s:%d' % (constants.HV_VNC_BIND_ADDRESS, display)
kvm_cmd.extend(['-vnc', vnc_arg])
logging.error("Network port is not a valid VNC display (%d < %d)."
" Not starting VNC" %
(instance.network_port, constants.HT_HVM_VNC_BASE_PORT))
kvm_cmd.extend(['-vnc', 'none'])
monitor_dev = 'unix:%s,server,nowait' % \
kvm_cmd.extend(['-monitor', monitor_dev])
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