Revision 377d74c9 lib/hypervisor/hv_kvm.py
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
280 | 280 |
if vnc_bind_address: |
281 | 281 |
kvm_cmd.extend(['-usbdevice', 'tablet']) |
282 | 282 |
if utils.IsValidIP(vnc_bind_address): |
283 |
if instance.network_port > constants.HT_HVM_VNC_BASE_PORT:
|
|
284 |
display = instance.network_port - constants.HT_HVM_VNC_BASE_PORT
|
|
283 |
if instance.network_port > constants.VNC_BASE_PORT: |
|
284 |
display = instance.network_port - constants.VNC_BASE_PORT |
|
285 | 285 |
if vnc_bind_address == '0.0.0.0': |
286 | 286 |
vnc_arg = ':%d' % (display) |
287 | 287 |
else: |
... | ... | |
290 | 290 |
logging.error("Network port is not a valid VNC display (%d < %d)." |
291 | 291 |
" Not starting VNC" % |
292 | 292 |
(instance.network_port, |
293 |
constants.HT_HVM_VNC_BASE_PORT))
|
|
293 |
constants.VNC_BASE_PORT)) |
|
294 | 294 |
vnc_arg = 'none' |
295 | 295 |
|
296 | 296 |
# Only allow tls and other option when not binding to a file, for now. |
... | ... | |
666 | 666 |
|
667 | 667 |
vnc_bind_address = hvparams[constants.HV_VNC_BIND_ADDRESS] |
668 | 668 |
if vnc_bind_address: |
669 |
if instance.network_port > constants.HT_HVM_VNC_BASE_PORT:
|
|
670 |
display = instance.network_port - constants.HT_HVM_VNC_BASE_PORT
|
|
669 |
if instance.network_port > constants.VNC_BASE_PORT: |
|
670 |
display = instance.network_port - constants.VNC_BASE_PORT |
|
671 | 671 |
vnc_command = ("echo 'Instance has VNC listening on %s:%d" |
672 | 672 |
" (display: %d)'" % (vnc_bind_address, |
673 | 673 |
instance.network_port, |
Also available in: Unified diff