virtinst: add support for <disk> sgio attribute

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2015-03-13 14:38:20 +01:00
parent ef286321f9
commit 31836e2b5d
5 changed files with 20 additions and 0 deletions

View File

@@ -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"/>

View File

@@ -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"/>

View File

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

View File

@@ -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):

View File

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