Re: [PATCH] virt-manager: Add additional info to disk details section

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel P. Berrange wrote:
> 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.

Reworked patch attached removing driver field.

- Cole

-- 
Cole Robinson
crobinso@xxxxxxxxxx
diff -r e96a36605e70 src/virtManager/details.py
--- a/src/virtManager/details.py	Tue Dec 11 10:19:11 2007 -0500
+++ b/src/virtManager/details.py	Thu Dec 13 10:41:12 2007 -0500
@@ -402,6 +402,13 @@ 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])
+            if diskinfo[4] == True:
+                perms = "Readonly"
+            else:
+                perms = "Read/Write"
+            if diskinfo[5] == 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 e96a36605e70 src/virtManager/domain.py
--- a/src/virtManager/domain.py	Tue Dec 11 10:19:11 2007 -0500
+++ b/src/virtManager/domain.py	Thu Dec 13 10:41:12 2007 -0500
@@ -482,6 +482,8 @@ class vmmDomain(gobject.GObject):
                 type = node.prop("type")
                 srcpath = None
                 devdst = None
+                readonly = False
+                sharable = False
                 devtype = node.prop("device")
                 if devtype == None:
                     devtype = "disk"
@@ -495,6 +497,11 @@ class vmmDomain(gobject.GObject):
                             type = "-"
                     elif child.name == "target":
                         devdst = child.prop("dev")
+                    elif child.name == "readonly":
+                        readonly = True
+                    elif child.name == "sharable":
+                        sharable = True
+                        
                 if srcpath == None:
                     if devtype == "cdrom":
                         srcpath = "-"
@@ -504,7 +511,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, readonly, \
+                              sharable])
 
         finally:
             if ctx != None:
diff -r e96a36605e70 src/vmm-details.glade
--- a/src/vmm-details.glade	Tue Dec 11 10:19:11 2007 -0500
+++ b/src/vmm-details.glade	Thu Dec 13 10:41:12 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">5</property>
 				  <property name="n_columns">3</property>
 				  <property name="homogeneous">False</property>
 				  <property name="row_spacing">3</property>
@@ -2169,6 +2169,62 @@
 				      <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="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">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">4</property>
+				      <property name="bottom_attach">5</property>
+				      <property name="x_options">fill</property>
 				      <property name="y_options"></property>
 				    </packing>
 				  </child>
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux