virt-manager: Add additional info to disk details section
The attached patch adds a couple fields to the details section for a disk
device in virt-manager: a 'Driver' field and a 'Permissions' field. The
driver field is written as "file" or "tap:aio" etc., and the permissions
field appears as "Readonly" or "Read/Write", with ", Sharable" tacked on
the end if applicable.
Thanks,
Cole
--
Cole Robinson
crobinso@redhat.com
--- a/src/virtManager/details.py Wed Dec 05 10:38:38 2007 -0500
+++ b/src/virtManager/details.py Wed Dec 05 12:44:24 2007 -0500
@@ -402,6 +402,14 @@ class vmmDetails(gobject.GObject):
self.window.get_widget("disk-source-path").set_text(diskinfo[1])
self.window.get_widget("disk-target-type").set_text(diskinfo[2])
self.window.get_widget("disk-target-device").set_text(diskinfo[3])
+ self.window.get_widget("disk-driver").set_text(diskinfo[4])
+ if diskinfo[5] == True:
+ perms = "Readonly"
+ else:
+ perms = "Read/Write"
+ if diskinfo[6] == True:
+ perms += ", Sharable"
+ self.window.get_widget("disk-permissions").set_text(perms)
button = self.window.get_widget("config-cdrom-connect")
if diskinfo[2] == "cdrom":
if diskinfo[1] == "-":
diff -r 404f442dfb82 -r 631d3985c2ad src/virtManager/domain.py
--- a/src/virtManager/domain.py Wed Dec 05 10:38:38 2007 -0500
+++ b/src/virtManager/domain.py Wed Dec 05 12:44:24 2007 -0500
@@ -482,7 +482,10 @@ class vmmDomain(gobject.GObject):
type = node.prop("type")
srcpath = None
devdst = None
+ readonly = False
+ sharable = False
devtype = node.prop("device")
+ driver = None
if devtype == None:
devtype = "disk"
for child in node.children:
@@ -495,6 +498,15 @@ class vmmDomain(gobject.GObject):
type = "-"
elif child.name == "target":
devdst = child.prop("dev")
+ elif child.name == "driver":
+ driver = child.prop("name")
+ if child.prop("dev") is not None:
+ driver = "%s:%s" % (driver, child.prop("dev"))
+ elif child.name == "readonly":
+ readonly = True
+ elif child.name == "sharable":
+ sharable = True
+
if srcpath == None:
if devtype == "cdrom":
srcpath = "-"
@@ -504,7 +516,8 @@ class vmmDomain(gobject.GObject):
if devdst == None:
raise RuntimeError("missing destination device")
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
12-10-2007, 06:57 PM
"Daniel P. Berrange"
virt-manager: Add additional info to disk details section
On Mon, Dec 10, 2007 at 01:49:18PM -0500, Cole Robinson wrote:
> The attached patch adds a couple fields to the details section for a disk
> device in virt-manager: a 'Driver' field and a 'Permissions' field. The
> driver field is written as "file" or "tap:aio" etc., and the permissions
> field appears as "Readonly" or "Read/Write", with ", Sharable" tacked on
> the end if applicable.
I've no problem adding the readonly/readwrite/sharable information.
I don't want the file:/tap:aio/etc stuff shown. Its an underlying implementation
detail over which the admin has no control - we automatically pick the driver
required according to virt type - and as such its not useful to show and people
aren't going to understand what it means.