Commit d08f6067 authored by Guido Trotter's avatar Guido Trotter
Browse files

Rename the device type constants

These are not HVM specific, so have been given an HT generic name.

Reviewed-by: iustinp
parent 377d74c9
......@@ -337,16 +337,15 @@ VNC_BASE_PORT = 5900
VNC_PASSWORD_FILE = _autoconf.SYSCONFDIR + "/ganeti/vnc-cluster-password"
VNC_DEFAULT_BIND_ADDRESS = '0.0.0.0'
# HVM NIC types
HT_HVM_NIC_RTL8139 = "rtl8139"
HT_HVM_NIC_NE2K_PCI = "ne2k_pci"
HT_HVM_NIC_NE2K_ISA = "ne2k_isa"
HT_HVM_DEV_PARAVIRTUAL = "paravirtual"
HT_HVM_DEV_IOEMU = "ioemu"
HT_HVM_VALID_NIC_TYPES = frozenset([HT_HVM_NIC_RTL8139, HT_HVM_NIC_NE2K_PCI,
HT_HVM_NIC_NE2K_ISA,
HT_HVM_DEV_PARAVIRTUAL])
HT_HVM_VALID_DISK_TYPES = frozenset([HT_HVM_DEV_PARAVIRTUAL, HT_HVM_DEV_IOEMU])
# Device types
HT_NIC_RTL8139 = "rtl8139"
HT_NIC_NE2K_PCI = "ne2k_pci"
HT_NIC_NE2K_ISA = "ne2k_isa"
HT_NIC_PARAVIRTUAL = HT_DISK_PARAVIRTUAL = "paravirtual"
HT_DISK_IOEMU = "ioemu"
HT_HVM_VALID_NIC_TYPES = frozenset([HT_NIC_RTL8139, HT_NIC_NE2K_PCI,
HT_NIC_NE2K_ISA, HT_NIC_PARAVIRTUAL])
HT_HVM_VALID_DISK_TYPES = frozenset([HT_DISK_PARAVIRTUAL, HT_DISK_IOEMU])
# Cluster Verify steps
VERIFY_NPLUSONE_MEM = 'nplusone_mem'
......@@ -443,8 +442,8 @@ HVC_DEFAULTS = {
HT_XEN_HVM: {
HV_BOOT_ORDER: "cd",
HV_CDROM_IMAGE_PATH: None,
HV_NIC_TYPE: HT_HVM_NIC_RTL8139,
HV_DISK_TYPE: HT_HVM_DEV_PARAVIRTUAL,
HV_NIC_TYPE: HT_NIC_RTL8139,
HV_DISK_TYPE: HT_DEV_PARAVIRTUAL,
HV_VNC_BIND_ADDRESS: '0.0.0.0',
HV_ACPI: True,
HV_PAE: True,
......
......@@ -617,7 +617,7 @@ class XenHvmHypervisor(XenHypervisor):
if nic_type is None:
# ensure old instances don't change
nic_type_str = ", type=ioemu"
elif nic_type == constants.HT_HVM_DEV_PARAVIRTUAL:
elif nic_type == constants.HT_NIC_PARAVIRTUAL:
nic_type_str = ", type=paravirtualized"
else:
nic_type_str = ", model=%s, type=ioemu" % nic_type
......@@ -632,7 +632,7 @@ class XenHvmHypervisor(XenHypervisor):
disk_data = cls._GetConfigFileDiskData(instance.disk_template,
block_devices)
disk_type = instance.hvparams[constants.HV_DISK_TYPE]
if disk_type in (None, constants.HT_HVM_DEV_IOEMU):
if disk_type in (None, constants.HT_DISK_IOEMU):
replacement = ",ioemu:hd"
else:
replacement = ",hd"
......
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