From ec91c05dcf7a148fb3fe78e96d56fb7763157c37 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Sat, 7 Feb 2009 09:04:15 +0000
Subject: [PATCH] KVM: don't boot from cdrom with no cdrom

Reviewed-by: iustinp
---
 lib/hypervisor/hv_kvm.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py
index ec7c07340..c8b63cea5 100644
--- a/lib/hypervisor/hv_kvm.py
+++ b/lib/hypervisor/hv_kvm.py
@@ -739,6 +739,9 @@ class KVMHypervisor(hv_base.BaseHypervisor):
     if boot_order not in ('cdrom', 'disk'):
       raise errors.HypervisorError("The boot order must be 'cdrom' or 'disk'")
 
+    if boot_order == 'cdrom' and not iso_path:
+      raise errors.HypervisorError("Cannot boot from cdrom without an ISO path")
+
   def ValidateParameters(self, hvparams):
     """Check the given parameters for validity.
 
-- 
GitLab