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.
This commit is contained in:
Cole Robinson 2013-06-13 16:00:33 -04:00
parent 0c9552bccb
commit 5a46e7420a
3 changed files with 11 additions and 34 deletions

View File

@ -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)

View File

@ -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()

View File

@ -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)