Revision 43440815 lib/hypervisor/hv_kvm.py

b/lib/hypervisor/hv_kvm.py
60 60
    constants.HV_VNC_X509_VERIFY,
61 61
    constants.HV_CDROM_IMAGE_PATH,
62 62
    constants.HV_BOOT_ORDER,
63
    constants.HV_NIC_TYPE,
64
    constants.HV_DISK_TYPE,
63 65
    ]
64 66

  
65 67
  _MIGRATION_STATUS_RE = re.compile('Migration\s+status:\s+(\w+)',
......
749 751
    if boot_order == 'cdrom' and not iso_path:
750 752
      raise errors.HypervisorError("Cannot boot from cdrom without an ISO path")
751 753

  
754
    nic_type = hvparams[constants.HV_NIC_TYPE]
755
    if nic_type not in constants.HT_KVM_VALID_NIC_TYPES:
756
      raise errors.HypervisorError("Invalid NIC type %s specified for the KVM"
757
                                   " hypervisor. Please choose one of: %s" %
758
                                   (nic_type,
759
                                    constants.HT_KVM_VALID_NIC_TYPES))
760

  
761
    disk_type = hvparams[constants.HV_DISK_TYPE]
762
    if disk_type not in constants.HT_KVM_VALID_DISK_TYPES:
763
      raise errors.HypervisorError("Invalid disk type %s specified for the KVM"
764
                                   " hypervisor. Please choose one of: %s" %
765
                                   (disk_type,
766
                                    constants.HT_KVM_VALID_DISK_TYPES))
767

  
752 768
  def ValidateParameters(self, hvparams):
753 769
    """Check the given parameters for validity.
754 770

  

Also available in: Unified diff