[virt-tools-list] [PATCH 1/5] virtinst: Expose disk/target/@removable

Fred A. Kemp anonym at riseup.net
Fri Oct 4 01:38:58 UTC 2013


From: "Fred A. Kemp" <anonym at riseup.net>

---
 tests/xmlparse-xml/change-disk-out.xml |    2 +-
 tests/xmlparse.py                      |    2 ++
 virtinst/devicedisk.py                 |    1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/xmlparse-xml/change-disk-out.xml b/tests/xmlparse-xml/change-disk-out.xml
index d5de699..e27a821 100644
--- a/tests/xmlparse-xml/change-disk-out.xml
+++ b/tests/xmlparse-xml/change-disk-out.xml
@@ -20,7 +20,7 @@
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type="file" device="disk">
       <source file="/dev/null"/>
-      <target dev="hda" bus="ide"/>
+      <target dev="hda" bus="usb" removable="on"/>
       <serial>frob</serial>
       <driver name="test" type="raw"/>
     </disk>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index 83ed948..fdff0e5 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -275,6 +275,8 @@ class XMLParseTest(unittest.TestCase):
         check("driver_name", None, "test")
         check("driver_type", None, "raw")
         check("serial", "WD-WMAP9A966149", "frob")
+        check("bus", "ide", "usb")
+        check("removable", None, False, True)
 
         check = self._make_checker(disk3)
         check("type", "block", "dir", "file", "block")
diff --git a/virtinst/devicedisk.py b/virtinst/devicedisk.py
index 48261cf..1b154af 100644
--- a/virtinst/devicedisk.py
+++ b/virtinst/devicedisk.py
@@ -534,6 +534,7 @@ class VirtualDisk(VirtualDevice):
 
     bus = XMLProperty("./target/@bus")
     target = XMLProperty("./target/@dev")
+    removable = XMLProperty("./target/@removable", is_onoff=True)
 
     read_only = XMLProperty("./readonly", is_bool=True)
     shareable = XMLProperty("./shareable", is_bool=True)
-- 
1.7.10.4




More information about the virt-tools-list mailing list