From: Guido Trotter <[email protected]>

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: Guido Trotter <[email protected]>
---
 lib/hypervisor/hv_kvm.py |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py
index cc64d8b..cffdb62 100644
--- a/lib/hypervisor/hv_kvm.py
+++ b/lib/hypervisor/hv_kvm.py
@@ -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])
 
-- 
1.7.10.4

Reply via email to