[virt-tools-list] [PATCH virt-manager 1/2] virtinst: add support for <disk> sgio attribute

Giuseppe Scrivano gscrivan at redhat.com
Fri Mar 13 13:43:30 UTC 2015


Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
 tests/xmlparse-xml/change-disk-in.xml  | 6 ++++++
 tests/xmlparse-xml/change-disk-out.xml | 6 ++++++
 tests/xmlparse.py                      | 6 ++++++
 virtinst/cli.py                        | 1 +
 virtinst/devicedisk.py                 | 1 +
 5 files changed, 20 insertions(+)

diff --git a/tests/xmlparse-xml/change-disk-in.xml b/tests/xmlparse-xml/change-disk-in.xml
index ba5df82..9c6005b 100644
--- a/tests/xmlparse-xml/change-disk-in.xml
+++ b/tests/xmlparse-xml/change-disk-in.xml
@@ -34,6 +34,12 @@
       <driver name='phy' error_policy='stop'/>
       <readonly/>
     </disk>
+    <disk type="block" device="lun">
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/sda'/>
+      <target dev='hdd' bus='scsi'/>
+      <readonly/>
+    </disk>
     <disk type="block" device="disk">
       <driver name="qemu" type="qcow2"/>
       <source dev="/dev/null"/>
diff --git a/tests/xmlparse-xml/change-disk-out.xml b/tests/xmlparse-xml/change-disk-out.xml
index 090bbb2..792f7ff 100644
--- a/tests/xmlparse-xml/change-disk-out.xml
+++ b/tests/xmlparse-xml/change-disk-out.xml
@@ -31,6 +31,12 @@
     <disk type="block" device="floppy">
       <target dev="fde" bus="fdc"/>
     </disk>
+    <disk type="block" device="lun" sgio="unfiltered">
+      <driver name="qemu" type="raw"/>
+      <source dev="/dev/sda"/>
+      <target dev="hdd" bus="scsi"/>
+      <readonly/>
+    </disk>
     <disk type="block" device="disk">
       <driver name="qemu" type="qcow2"/>
       <source dev="/dev/null"/>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index 140fd5c..c98f061 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -347,6 +347,12 @@ class XMLParseTest(unittest.TestCase):
         check("bus", "ide", "fdc")
         check("error_policy", "stop", None)
 
+        disk = _get_disk("hdd")
+        check = self._make_checker(disk)
+        check("type", "block")
+        check("device", "lun")
+        check("sgio", None, "unfiltered")
+
         disk = _get_disk("sda")
         check = self._make_checker(disk)
         check("path", None, "http://[1:2:3:4:5:6:7:8]:1122/my/file")
diff --git a/virtinst/cli.py b/virtinst/cli.py
index caf7a62..642e4eb 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1532,6 +1532,7 @@ class ParserDisk(VirtCLIParser):
         self.set_param("iotune_ris", "read_iops_sec")
         self.set_param("iotune_wis", "write_iops_sec")
         self.set_param("iotune_tis", "total_iops_sec")
+        self.set_param("sgio", "sgio")
 
 
     def _parse(self, opts, inst):
diff --git a/virtinst/devicedisk.py b/virtinst/devicedisk.py
index 7129496..d40b6a9 100644
--- a/virtinst/devicedisk.py
+++ b/virtinst/devicedisk.py
@@ -742,6 +742,7 @@ class VirtualDisk(VirtualDevice):
     driver_type = XMLProperty("./driver/@type",
                               default_cb=_get_default_driver_type)
 
+    sgio = XMLProperty("./@sgio")
 
     bus = XMLProperty("./target/@bus")
     target = XMLProperty("./target/@dev")
-- 
2.1.0




More information about the virt-tools-list mailing list