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

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

 



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@xxxxxxxxxx
--- 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@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