diff --git a/tests/cli-test-xml/compare/virt-xml-edit-clear-clock.xml b/tests/cli-test-xml/compare/virt-xml-edit-clear-clock.xml index 70ee019b..99f0865f 100644 --- a/tests/cli-test-xml/compare/virt-xml-edit-clear-clock.xml +++ b/tests/cli-test-xml/compare/virt-xml-edit-clear-clock.xml @@ -9,7 +9,7 @@ destroy restart restart -@@ -333,4 +328,5 @@ +@@ -339,4 +334,5 @@
diff --git a/tests/cli-test-xml/compare/virt-xml-edit-clear-cpu.xml b/tests/cli-test-xml/compare/virt-xml-edit-clear-cpu.xml index 8db2c2e1..d9661488 100644 --- a/tests/cli-test-xml/compare/virt-xml-edit-clear-cpu.xml +++ b/tests/cli-test-xml/compare/virt-xml-edit-clear-cpu.xml @@ -21,7 +21,7 @@ -@@ -333,4 +316,5 @@ +@@ -339,4 +322,5 @@
diff --git a/tests/cli-test-xml/compare/virt-xml-edit-select-disk-path.xml b/tests/cli-test-xml/compare/virt-xml-edit-select-disk-path.xml index a045687a..3fbcc733 100644 --- a/tests/cli-test-xml/compare/virt-xml-edit-select-disk-path.xml +++ b/tests/cli-test-xml/compare/virt-xml-edit-select-disk-path.xml @@ -5,8 +5,8 @@ + - - + + Domain 'test-many-devices' defined successfully. Changes will take effect after the next domain shutdown. \ No newline at end of file diff --git a/tests/cli-test-xml/compare/virt-xml-edit-simple-metadata.xml b/tests/cli-test-xml/compare/virt-xml-edit-simple-metadata.xml index ad2fbcc1..15b464fe 100644 --- a/tests/cli-test-xml/compare/virt-xml-edit-simple-metadata.xml +++ b/tests/cli-test-xml/compare/virt-xml-edit-simple-metadata.xml @@ -12,7 +12,7 @@ 409600 204800 -@@ -333,4 +333,5 @@ +@@ -339,4 +339,5 @@
diff --git a/tests/testdriver.xml b/tests/testdriver.xml index 25dffd9d..579c756e 100644 --- a/tests/testdriver.xml +++ b/tests/testdriver.xml @@ -174,6 +174,12 @@ + + + + + + diff --git a/tests/xmlparse-xml/change-disk-in.xml b/tests/xmlparse-xml/change-disk-in.xml index 12f58cd5..9725e9b9 100644 --- a/tests/xmlparse-xml/change-disk-in.xml +++ b/tests/xmlparse-xml/change-disk-in.xml @@ -62,6 +62,12 @@ + + + + + + diff --git a/tests/xmlparse-xml/change-disk-out.xml b/tests/xmlparse-xml/change-disk-out.xml index 4bca70e0..d9af1e30 100644 --- a/tests/xmlparse-xml/change-disk-out.xml +++ b/tests/xmlparse-xml/change-disk-out.xml @@ -64,6 +64,12 @@ + + + + + + diff --git a/tests/xmlparse.py b/tests/xmlparse.py index 870bf36a..62aa4100 100644 --- a/tests/xmlparse.py +++ b/tests/xmlparse.py @@ -331,6 +331,7 @@ class XMLParseTest(unittest.TestCase): disk3.size = 1 disk6 = disks[5] disk6.size = 1 + disk9 = disks[8] check = self._make_checker(disk1) check("path", "/tmp/test.img", "/dev/null") @@ -370,6 +371,9 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(disk6.boot) check("order", None, 7, None) + check = self._make_checker(disk9) + check("sourcePool", "defaultPool", "anotherPool") + self._alter_compare(guest.get_xml_config(), outfile) def testSingleDisk(self): diff --git a/virtinst/devicedisk.py b/virtinst/devicedisk.py index 4088b0af..1d764d9e 100644 --- a/virtinst/devicedisk.py +++ b/virtinst/devicedisk.py @@ -182,7 +182,8 @@ class VirtualDisk(VirtualDevice): TYPE_FILE = "file" TYPE_BLOCK = "block" TYPE_DIR = "dir" - types = [TYPE_FILE, TYPE_BLOCK, TYPE_DIR] + TYPE_VOLUME = "volume" + types = [TYPE_FILE, TYPE_BLOCK, TYPE_DIR, TYPE_VOLUME] IO_MODE_NATIVE = "native" IO_MODE_THREADS = "threads" @@ -214,6 +215,8 @@ class VirtualDisk(VirtualDevice): return "dev" elif disk_type == VirtualDisk.TYPE_DIR: return "dir" + elif disk_type == VirtualDisk.TYPE_VOLUME: + return "volume" return "file" @staticmethod @@ -606,6 +609,7 @@ class VirtualDisk(VirtualDevice): clear_first=["./source/@" + target for target in _TARGET_PROPS]) + sourcePool = XMLProperty("./source/@pool") sourceStartupPolicy = XMLProperty("./source/@startupPolicy") device = XMLProperty("./@device", default_cb=lambda s: s.DEVICE_DISK)