Commit 81e265f5 authored by Guido Trotter's avatar Guido Trotter
Browse files

kvm: Move parameter validation before use



We had parameter validation when the runtime is generated, but in the
middle of the function. Move up, before any parameter is accessed.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
parent 99c7cd5b
......@@ -1019,6 +1019,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
"""
# pylint: disable=R0912,R0914,R0915
hvp = instance.hvparams
self.ValidateParameters(hvp)
pidfile = self._InstancePidFile(instance.name)
kvm = hvp[constants.HV_KVM_PATH]
......@@ -1060,8 +1061,6 @@ class KVMHypervisor(hv_base.BaseHypervisor):
boot_floppy = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_FLOPPY
boot_network = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_NETWORK
self.ValidateParameters(hvp)
if startup_paused:
kvm_cmd.extend([_KVM_START_PAUSED_FLAG])
......
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