Commit 5bc84f33 authored by Alexander Schreiber's avatar Alexander Schreiber
Browse files

merge r1538 from branches/ganeti/ganeti-1.2

Check HVM device type on instance modify as well.

Reviewed-by: imsnah
parent cfefe007
......@@ -4340,6 +4340,17 @@ class LUSetInstanceParams(LogicalUnit):
self.warn.append("Not enough memory to failover instance to secondary"
" node %s" % node)
# Xen HVM device type checks
if self.sstore.GetHypervisorType() == constants.HT_XEN_HVM31:
if self.op.hvm_nic_type is not None:
if self.op.hvm_nic_type not in constants.HT_HVM_VALID_NIC_TYPES:
raise errors.OpPrereqError("Invalid NIC type %s specified for Xen"
" HVM hypervisor" % self.op.hvm_nic_type)
if self.op.hvm_disk_type is not None:
if self.op.hvm_disk_type not in constants.HT_HVM_VALID_DISK_TYPES:
raise errors.OpPrereqError("Invalid disk type %s specified for Xen"
" HVM hypervisor" % self.op.hvm_disk_type)
return
def Exec(self, feedback_fn):
......
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