mirror of
https://github.com/virt-manager/virt-manager.git
synced 2026-07-29 15:55:32 -05:00
uihelpers: Move a few more functions closer to their callers
This commit is contained in:
@@ -129,6 +129,33 @@ class vmmConnection(vmmGObject):
|
||||
self._init_virtconn()
|
||||
|
||||
|
||||
@staticmethod
|
||||
def pretty_hv(gtype, domtype):
|
||||
"""
|
||||
Convert XML <domain type='foo'> and <os><type>bar</type>
|
||||
into a more human relevant string.
|
||||
"""
|
||||
|
||||
gtype = gtype.lower()
|
||||
domtype = domtype.lower()
|
||||
|
||||
label = domtype
|
||||
if domtype == "kvm":
|
||||
if gtype == "xen":
|
||||
label = "xenner"
|
||||
elif domtype == "xen":
|
||||
if gtype == "xen":
|
||||
label = "xen (paravirt)"
|
||||
elif gtype == "hvm":
|
||||
label = "xen (fullvirt)"
|
||||
elif domtype == "test":
|
||||
if gtype == "xen":
|
||||
label = "test (xen)"
|
||||
elif gtype == "hvm":
|
||||
label = "test (hvm)"
|
||||
|
||||
return label
|
||||
|
||||
#################
|
||||
# Init routines #
|
||||
#################
|
||||
@@ -713,6 +740,8 @@ class vmmConnection(vmmGObject):
|
||||
if p.get_name() == name:
|
||||
return p
|
||||
return None
|
||||
def get_default_pool(self):
|
||||
return self.get_pool_by_name("default")
|
||||
|
||||
def get_vol_by_path(self, path):
|
||||
for pool in self.pools.values():
|
||||
|
||||
Reference in New Issue
Block a user