host: Print iscsi volume key as well in volume list

Suggested here: http://www.redhat.com/archives/virt-tools-list/2013-December/msg00014.html
This commit is contained in:
Cole Robinson 2013-12-05 09:17:29 -05:00
parent 70f1f8df1e
commit 2a25c8d37d
2 changed files with 13 additions and 1 deletions

View File

@ -1316,7 +1316,7 @@ def populate_storage_volumes(list_widget, pool, sensitive_cb):
try:
path = vol.get_target_path()
name = vol.get_name()
name = vol.get_pretty_name(pool.get_type())
cap = vol.get_pretty_capacity()
fmt = vol.get_format() or ""
except:

View File

@ -62,6 +62,8 @@ class vmmStorageVolume(vmmLibvirtObject):
# XML accessors #
#################
def get_key(self):
return self.get_xmlobj().key or ""
def get_target_path(self):
return self.get_xmlobj().target_path or ""
def get_format(self):
@ -76,6 +78,16 @@ class vmmStorageVolume(vmmLibvirtObject):
def get_pretty_allocation(self):
return util.pretty_bytes(self.get_allocation())
def get_pretty_name(self, pooltype):
name = self.get_name()
if pooltype != "iscsi":
return name
key = self.get_key()
if not key:
return name
return "%s (%s)" % (name, key)
class vmmStoragePool(vmmLibvirtObject):
__gsignals__ = {