Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora/Linux Management Tools (http://www.linux-archive.org/fedora-linux-management-tools/)
-   -   virt-manager: Add additional info to disk details section (http://www.linux-archive.org/fedora-linux-management-tools/16491-virt-manager-add-additional-info-disk-details-section.html)

Cole Robinson 12-10-2007 05:49 PM

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

- disks.append([type, srcpath, devtype, devdst])
+ disks.append([type, srcpath, devtype, devdst, driver,
+ readonly, sharable])

finally:
if ctx != None:
diff -r 404f442dfb82 -r 631d3985c2ad src/vmm-details.glade
--- a/src/vmm-details.glade Wed Dec 05 10:38:38 2007 -0500
+++ b/src/vmm-details.glade Wed Dec 05 12:44:24 2007 -0500
@@ -1923,7 +1923,7 @@
<widget class="GtkTable" id="table32">
<property name="border_width">3</property>
<property name="visible">True</property>
- <property name="n_rows">4</property>
+ <property name="n_rows">6</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">3</property>
@@ -2169,6 +2169,118 @@
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="driver-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Driver:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="permissions-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Permissions:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="disk-driver">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">label422</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="disk-permissions">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">label423</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

"Daniel P. Berrange" 12-10-2007 06:57 PM

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.

Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


All times are GMT. The time now is 07:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.