connection: Revive option to show QEMU/KVM in pretty desc

I thought it was unused, but it was just grep fail
This commit is contained in:
Cole Robinson 2014-07-07 17:57:50 -04:00
parent 02e2fd9cd4
commit 9986074ab0
2 changed files with 10 additions and 2 deletions

View File

@ -355,7 +355,11 @@ class vmmConnection(vmmGObject):
####################################
def get_pretty_desc(self, shorthost=True, show_transport=False,
show_user=False):
show_user=False, show_kvm=False):
"""
@show_kvm: Show hv as QEMU/KVM. Only works if connection is
active though
"""
def match_whole_string(orig, reg):
match = re.match(reg, orig)
if not match:
@ -416,6 +420,9 @@ class vmmConnection(vmmGObject):
if scheme in pretty_map:
hv = pretty_map[scheme]
if hv == "QEMU" and show_kvm and self.caps.is_kvm_available():
hv += "/KVM"
if show_transport and transport:
hv += "+" + transport

View File

@ -763,7 +763,8 @@ class vmmCreate(vmmGObjectUI):
# Favor local connections over remote connections
default = len(model)
model.append([connobj.get_uri(), connobj.get_pretty_desc()])
model.append([connobj.get_uri(),
connobj.get_pretty_desc(show_kvm=True)])
no_conns = (len(model) == 0)