From a2cbb9f500f3661fe471bec988f52f32a8d9dd81 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 2 Oct 2013 16:41:23 -0400 Subject: [PATCH] support: s/CONN_HV/CONN/g We don't need to distinguish these days. --- virtManager/addhardware.py | 5 ++- virtManager/connection.py | 2 -- virtManager/create.py | 2 +- virtManager/uihelpers.py | 2 +- virtinst/connection.py | 2 -- virtinst/guest.py | 15 ++++----- virtinst/osdict.py | 2 +- virtinst/support.py | 65 ++++++++++++-------------------------- 8 files changed, 32 insertions(+), 63 deletions(-) diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py index beb152700..25b7db77b 100644 --- a/virtManager/addhardware.py +++ b/virtManager/addhardware.py @@ -370,9 +370,8 @@ class vmmAddHardware(vmmGObjectUI): self.vm.is_hvm(), _("Not supported for this guest type.")) add_hw_option("Filesystem", Gtk.STOCK_DIRECTORY, PAGE_FILESYSTEM, - self.conn.check_conn_hv_support( - self.conn.SUPPORT_CONN_HV_FILESYSTEM, - self.vm.get_hv_type()), + self.conn.check_conn_support( + self.conn.SUPPORT_CONN_FILESYSTEM), _("Not supported for this hypervisor/libvirt " "combination.")) add_hw_option("Smartcard", "device_serial", PAGE_SMARTCARD, diff --git a/virtManager/connection.py b/virtManager/connection.py index 5983fe38a..cd2de9478 100644 --- a/virtManager/connection.py +++ b/virtManager/connection.py @@ -430,8 +430,6 @@ class vmmConnection(vmmGObject): _supportname) def check_conn_support(self, *args): return self._backend.check_conn_support(*args) - def check_conn_hv_support(self, *args): - return self._backend.check_conn_hv_support(*args) def check_domain_support(self, *args): return self._backend.check_domain_support(*args) def check_pool_support(self, *args): diff --git a/virtManager/create.py b/virtManager/create.py index a5adf6628..2371a1eb6 100644 --- a/virtManager/create.py +++ b/virtManager/create.py @@ -1475,7 +1475,7 @@ class vmmCreate(vmmGObjectUI): return support_spice = guest.conn.check_conn_support( - guest.conn.SUPPORT_CONN_HV_GRAPHICS_SPICE) + guest.conn.SUPPORT_CONN_GRAPHICS_SPICE) if not self._rhel6_defaults(): support_spice = True diff --git a/virtManager/uihelpers.py b/virtManager/uihelpers.py index 0bc411d8a..81308a2c3 100644 --- a/virtManager/uihelpers.py +++ b/virtManager/uihelpers.py @@ -616,7 +616,7 @@ def populate_network_list(net_list, conn, show_direct_interfaces=True): else: if (show_direct_interfaces and conn.check_conn_support( - conn.SUPPORT_CONN_HV_DIRECT_INTERFACE)): + conn.SUPPORT_CONN_DIRECT_INTERFACE)): sensitive = True nettype = virtinst.VirtualNetworkInterface.TYPE_DIRECT bridge_name = name diff --git a/virtinst/connection.py b/virtinst/connection.py index 9e69e9d70..46de381b2 100644 --- a/virtinst/connection.py +++ b/virtinst/connection.py @@ -351,8 +351,6 @@ class VirtualConnection(object): def check_conn_support(self, feature): return self._check_support(feature, self) - def check_conn_hv_support(self, feature, hv): - return self._check_support(feature, hv) def check_domain_support(self, dom, feature): return self._check_support(feature, dom) def check_pool_support(self, pool, feature): diff --git a/virtinst/guest.py b/virtinst/guest.py index 7c4228cbe..bfc331278 100644 --- a/virtinst/guest.py +++ b/virtinst/guest.py @@ -634,9 +634,8 @@ class Guest(XMLBuilder): default = True if (self._lookup_osdict_key("xen_disable_acpi", False) and - self.conn.check_conn_hv_support( - support.SUPPORT_CONN_HV_SKIP_DEFAULT_ACPI, - self.type)): + self.conn.check_conn_support( + support.SUPPORT_CONN_SKIP_DEFAULT_ACPI)): default = False if self.features.acpi == "default": @@ -765,11 +764,11 @@ class Guest(XMLBuilder): inp.bus = input_bus def _set_sound_defaults(self): - if self.conn.check_conn_hv_support( - support.SUPPORT_CONN_HV_SOUND_ICH6, self.type): + if self.conn.check_conn_support( + support.SUPPORT_CONN_SOUND_ICH6): default = "ich6" - elif self.conn.check_conn_hv_support( - support.SUPPORT_CONN_HV_SOUND_AC97, self.type): + elif self.conn.check_conn_support( + support.SUPPORT_CONN_SOUND_AC97): default = "ac97" else: default = "es1370" @@ -802,7 +801,7 @@ class Guest(XMLBuilder): if (has_spice() and not has_spice_agent() and self.conn.check_conn_support( - self.conn.SUPPORT_CONN_HV_CHAR_SPICEVMC)): + self.conn.SUPPORT_CONN_CHAR_SPICEVMC)): agentdev = virtinst.VirtualChannelDevice(self.conn) agentdev.type = agentdev.TYPE_SPICEVMC self.add_device(agentdev) diff --git a/virtinst/osdict.py b/virtinst/osdict.py index 8f3801cda..6b3ee2065 100644 --- a/virtinst/osdict.py +++ b/virtinst/osdict.py @@ -133,7 +133,7 @@ class _OSVariant(object): squeezing out current ones. @three_stage_install: If True, this VM has a 3 stage install, AKA windows. @xen_disable_acpi: If True, disable acpi/apic for this OS if on old xen. - This corresponds with the SUPPORT_CONN_HV_SKIP_DEFAULT_ACPI check + This corresponds with the SUPPORT_CONN_SKIP_DEFAULT_ACPI check @virtionet: If True, this OS supports virtionet out of the box @virtiodisk: If True, this OS supports virtiodisk out of the box @virtiommio: If True, this OS supports virtio-mmio out of the box, diff --git a/virtinst/support.py b/virtinst/support.py index 5d306cd0b..24a20823e 100644 --- a/virtinst/support.py +++ b/virtinst/support.py @@ -125,8 +125,6 @@ class _SupportCheck(object): If a hypervisor is not listed, it is assumed to be NOT SUPPORTED. @drv_libvirt_version: List of tuples, similar to drv_version, but the version number is minimum supported _libvirt_ version - @hv_version: A list of tuples of the same form as drv_version, however - listing the actual from the XML. example: 'kvm' @rhel6_version @rhel6_drv_version: Analog of the above params, but for versions for @@ -136,7 +134,7 @@ class _SupportCheck(object): def __init__(self, function=None, args=None, flag=None, version=None, force_version=None, - drv_version=None, drv_libvirt_version=None, hv_version=None, + drv_version=None, drv_libvirt_version=None, rhel6_drv_version=None, rhel6_version=None): self.function = function self.args = args @@ -145,7 +143,6 @@ class _SupportCheck(object): self.force_version = bool(force_version) self.drv_version = drv_version or [] self.drv_libvirt_version = drv_libvirt_version or [] - self.hv_version = hv_version or [] self.rhel6_version = rhel6_version and int(rhel6_version) or 0 self.rhel6_drv_version = rhel6_drv_version or [] @@ -258,26 +255,6 @@ class _SupportCheck(object): if not found: return False - if self.hv_version: - found = False - hv_type = data - for hv, min_hv_ver in self.hv_version: - if hv != hv_type: - continue - - # No HV specific version info, just use driver version - if min_hv_ver < 0: - if actual_drv_ver <= -min_hv_ver: - found = True - break - else: - if actual_drv_ver >= min_hv_ver: - found = True - break - - if not found: - return False - return True @@ -332,6 +309,25 @@ SUPPORT_CONN_DEFAULT_QCOW2 = _make( version=8000, drv_version=[("qemu", 1002000), ("test", 0)]) SUPPORT_CONN_DEFAULT_USB2 = _make( version=9007, drv_version=[("qemu", 1000000), ("test", 0)]) +SUPPORT_CONN_SKIP_DEFAULT_ACPI = _make(drv_version=[("xen", -3001000)]) +SUPPORT_CONN_SOUND_AC97 = _make(version=6000, + force_version=True, + drv_version=[("qemu", 11000)]) +SUPPORT_CONN_SOUND_ICH6 = _make(version=8008, + drv_version=[("qemu", 14000)], + rhel6_drv_version=[("qemu", 12001)], + rhel6_version=8007) +SUPPORT_CONN_GRAPHICS_SPICE = _make(version=8006, + drv_version=[("qemu", 14000)]) +SUPPORT_CONN_CHAR_SPICEVMC = _make(version=8008, + drv_version=[("qemu", 14000)]) +SUPPORT_CONN_DIRECT_INTERFACE = _make(version=8007, + drv_version=[("qemu", 0), + ("test", 0)]) +SUPPORT_CONN_FILESYSTEM = _make( + drv_version=[("qemu", 13000), ("lxc", 0), ("openvz", 0), ("test", 0)], + drv_libvirt_version=[("qemu", 8005), ("lxc", 0), + ("openvz", 0), ("test", 0)]) # Domain checks SUPPORT_DOMAIN_GETVCPUS = _make(function="virDomain.vcpus", args=()) @@ -374,27 +370,6 @@ SUPPORT_INTERFACE_XML_INACTIVE = _make(function="virInterface.XMLDesc", SUPPORT_INTERFACE_ISACTIVE = _make(function="virInterface.isActive", args=()) -# Conn HV checks -SUPPORT_CONN_HV_SKIP_DEFAULT_ACPI = _make(drv_version=[("xen", -3001000)]) -SUPPORT_CONN_HV_SOUND_AC97 = _make(version=6000, - force_version=True, - drv_version=[("qemu", 11000)]) -SUPPORT_CONN_HV_SOUND_ICH6 = _make(version=8008, - drv_version=[("qemu", 14000)], - rhel6_drv_version=[("qemu", 12001)], - rhel6_version=8007) -SUPPORT_CONN_HV_GRAPHICS_SPICE = _make(version=8006, - drv_version=[("qemu", 14000)]) -SUPPORT_CONN_HV_CHAR_SPICEVMC = _make(version=8008, - drv_version=[("qemu", 14000)]) -SUPPORT_CONN_HV_DIRECT_INTERFACE = _make(version=8007, - drv_version=[("qemu", 0), - ("test", 0)]) -SUPPORT_CONN_HV_FILESYSTEM = _make( - drv_version=[("qemu", 13000), ("lxc", 0), ("openvz", 0), ("test", 0)], - drv_libvirt_version=[("qemu", 8005), ("lxc", 0), - ("openvz", 0), ("test", 0)]) - # Stream checks # Latest I tested with, and since we will use it by default # for URL installs, want to be sure it works