summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2013-06-13 16:00:33 -0400
committerCole Robinson <crobinso@redhat.com>2013-06-13 16:04:16 -0400
commit5a46e7420a367f1e06af4f4e22c547b896d45eba (patch)
treea8730baa7d4fd306f7e0b988cf9b79b82771b333
parent0c9552bccbd1f422e3b71591a42696a83b78a767 (diff)
downloadvirt-manager-5a46e7420a367f1e06af4f4e22c547b896d45eba.tar.gz
libguestfs: Drop all version checks
Now that virt-manager requires very modern versions of gtk, it's quite unlikely that we will even run on a system with an old libguestfs version, so don't bother checking versions.
-rw-r--r--virtManager/config.py23
-rw-r--r--virtManager/engine.py6
-rw-r--r--virtManager/inspection.py16
3 files changed, 11 insertions, 34 deletions
diff --git a/virtManager/config.py b/virtManager/config.py
index 52f4142f..19e030ca 100644
--- a/virtManager/config.py
+++ b/virtManager/config.py
@@ -185,27 +185,10 @@ class vmmConfig(object):
try:
# Check we can open the Python guestfs module.
from guestfs import GuestFS # pylint: disable=F0401
- g = GuestFS()
-
- # Check for the first version which fixed Python GIL bug.
- version = g.version()
- if version["major"] == 1: # major must be 1
- if version["minor"] == 8:
- if version["release"] >= 6: # >= 1.8.6
- return True
- elif version["minor"] == 10:
- if version["release"] >= 1: # >= 1.10.1
- return True
- elif version["minor"] == 11:
- if version["release"] >= 2: # >= 1.11.2
- return True
- elif version["minor"] >= 12: # >= 1.12, 1.13, etc.
- return True
+ GuestFS()
+ return True
except:
- pass
-
- return False
-
+ return False
# General app wide helpers (gconf agnostic)
diff --git a/virtManager/engine.py b/virtManager/engine.py
index f395050b..e7b0a8e2 100644
--- a/virtManager/engine.py
+++ b/virtManager/engine.py
@@ -405,11 +405,11 @@ class vmmEngine(vmmGObject):
self.application.remove_window(self._appwindow)
def _create_inspection_thread(self):
+ logging.debug("libguestfs inspection support: %s",
+ self.config.support_inspection)
if not self.config.support_inspection:
- logging.debug("No inspection thread because "
- "libguestfs is too old, not available, "
- "or libvirt is not thread safe.")
return
+
from virtManager.inspection import vmmInspection
self.inspection = vmmInspection()
self.inspection.start()
diff --git a/virtManager/inspection.py b/virtManager/inspection.py
index fa81e0ef..f2c9020a 100644
--- a/virtManager/inspection.py
+++ b/virtManager/inspection.py
@@ -189,11 +189,7 @@ class vmmInspection(vmmGObject):
minor_version = g.inspect_get_minor_version(root) # eg. 0
hostname = g.inspect_get_hostname(root) # string
product_name = g.inspect_get_product_name(root) # string
-
- # Added in libguestfs 1.9.13:
- product_variant = None
- if hasattr(g, "inspect_get_product_variant"):
- product_variant = g.inspect_get_product_variant(root) # string
+ product_variant = g.inspect_get_product_variant(root) # string
# For inspect_list_applications and inspect_get_icon we
# require that the guest filesystems are mounted. However
@@ -231,12 +227,10 @@ class vmmInspection(vmmGObject):
icon = None
apps = None
if filesystems_mounted:
- # Added in libguestfs 1.11.12:
- if hasattr(g, "inspect_get_icon"):
- # string containing PNG data
- icon = g.inspect_get_icon(root, favicon=0, highquality=1)
- if icon == "":
- icon = None
+ # string containing PNG data
+ icon = g.inspect_get_icon(root, favicon=0, highquality=1)
+ if icon == "":
+ icon = None
# Inspection applications.
apps = g.inspect_list_applications(root)