Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -337,16 +337,15 @@ VNC_BASE_PORT = 5900 ...@@ -337,16 +337,15 @@ VNC_BASE_PORT = 5900
VNC_PASSWORD_FILE = _autoconf.SYSCONFDIR + "/ganeti/vnc-cluster-password" VNC_PASSWORD_FILE = _autoconf.SYSCONFDIR + "/ganeti/vnc-cluster-password"
VNC_DEFAULT_BIND_ADDRESS = '0.0.0.0' VNC_DEFAULT_BIND_ADDRESS = '0.0.0.0'
# HVM NIC types # Device types
HT_HVM_NIC_RTL8139 = "rtl8139" HT_NIC_RTL8139 = "rtl8139"
HT_HVM_NIC_NE2K_PCI = "ne2k_pci" HT_NIC_NE2K_PCI = "ne2k_pci"
HT_HVM_NIC_NE2K_ISA = "ne2k_isa" HT_NIC_NE2K_ISA = "ne2k_isa"
HT_HVM_DEV_PARAVIRTUAL = "paravirtual" HT_NIC_PARAVIRTUAL = HT_DISK_PARAVIRTUAL = "paravirtual"
HT_HVM_DEV_IOEMU = "ioemu" HT_DISK_IOEMU = "ioemu"
HT_HVM_VALID_NIC_TYPES = frozenset([HT_HVM_NIC_RTL8139, HT_HVM_NIC_NE2K_PCI, HT_HVM_VALID_NIC_TYPES = frozenset([HT_NIC_RTL8139, HT_NIC_NE2K_PCI,
HT_HVM_NIC_NE2K_ISA, HT_NIC_NE2K_ISA, HT_NIC_PARAVIRTUAL])
HT_HVM_DEV_PARAVIRTUAL]) HT_HVM_VALID_DISK_TYPES = frozenset([HT_DISK_PARAVIRTUAL, HT_DISK_IOEMU])
HT_HVM_VALID_DISK_TYPES = frozenset([HT_HVM_DEV_PARAVIRTUAL, HT_HVM_DEV_IOEMU])
# Cluster Verify steps # Cluster Verify steps
VERIFY_NPLUSONE_MEM = 'nplusone_mem' VERIFY_NPLUSONE_MEM = 'nplusone_mem'
...@@ -443,8 +442,8 @@ HVC_DEFAULTS = { ...@@ -443,8 +442,8 @@ HVC_DEFAULTS = {
HT_XEN_HVM: { HT_XEN_HVM: {
HV_BOOT_ORDER: "cd", HV_BOOT_ORDER: "cd",
HV_CDROM_IMAGE_PATH: None, HV_CDROM_IMAGE_PATH: None,
HV_NIC_TYPE: HT_HVM_NIC_RTL8139, HV_NIC_TYPE: HT_NIC_RTL8139,
HV_DISK_TYPE: HT_HVM_DEV_PARAVIRTUAL, HV_DISK_TYPE: HT_DEV_PARAVIRTUAL,
HV_VNC_BIND_ADDRESS: '0.0.0.0', HV_VNC_BIND_ADDRESS: '0.0.0.0',
HV_ACPI: True, HV_ACPI: True,
HV_PAE: True, HV_PAE: True,
......
...@@ -617,7 +617,7 @@ class XenHvmHypervisor(XenHypervisor): ...@@ -617,7 +617,7 @@ class XenHvmHypervisor(XenHypervisor):
if nic_type is None: if nic_type is None:
# ensure old instances don't change # ensure old instances don't change
nic_type_str = ", type=ioemu" 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" nic_type_str = ", type=paravirtualized"
else: else:
nic_type_str = ", model=%s, type=ioemu" % nic_type nic_type_str = ", model=%s, type=ioemu" % nic_type
...@@ -632,7 +632,7 @@ class XenHvmHypervisor(XenHypervisor): ...@@ -632,7 +632,7 @@ class XenHvmHypervisor(XenHypervisor):
disk_data = cls._GetConfigFileDiskData(instance.disk_template, disk_data = cls._GetConfigFileDiskData(instance.disk_template,
block_devices) block_devices)
disk_type = instance.hvparams[constants.HV_DISK_TYPE] 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" replacement = ",ioemu:hd"
else: else:
replacement = ",hd" replacement = ",hd"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment