Commit 56fee73b authored by Guido Trotter's avatar Guido Trotter
Browse files

KVM: Allow the HV_VNC_BIND_ADDRESS parameter

Reviewed-by: iustinp
parent 2928f08d
......@@ -448,6 +448,7 @@ HVC_DEFAULTS = {
HV_ROOT_PATH: '/dev/vda',
HV_ACPI: True,
HV_SERIAL_CONSOLE: True,
HV_VNC_BIND_ADDRESS: None,
},
HT_FAKE: {
},
......
......@@ -54,6 +54,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
constants.HV_ROOT_PATH,
constants.HV_ACPI,
constants.HV_SERIAL_CONSOLE,
constants.HV_VNC_BIND_ADDRESS,
]
_MIGRATION_STATUS_RE = re.compile('Migration\s+status:\s+(\w+)',
......@@ -649,6 +650,13 @@ class KVMHypervisor(hv_base.BaseHypervisor):
raise errors.HypervisorError("The initrd path must an absolute path"
", if defined")
vnc_bind_address = hvparams[constants.HV_VNC_BIND_ADDRESS]
if vnc_bind_address:
if not utils.IsValidIP(vnc_bind_address):
raise errors.OpPrereqError("given VNC bind address '%s' doesn't look"
" like a valid IP address" %
vnc_bind_address)
def ValidateParameters(self, hvparams):
"""Check the given parameters for validity.
......
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