diff --git a/man/virt-install.pod b/man/virt-install.pod index a2630316..657ef8cb 100644 --- a/man/virt-install.pod +++ b/man/virt-install.pod @@ -1230,6 +1230,10 @@ Network device (in LXC container). Character device (in LXC container). +=item B<--hostdev /dev/sdf,type=storage> + +Block device (in LXC container). + =back Use --hostdev=? to see a list of all available sub options. Complete details at L diff --git a/tests/xmlparse-xml/change-hostdevs-in.xml b/tests/xmlparse-xml/change-hostdevs-in.xml index c93253b4..ed173a6a 100644 --- a/tests/xmlparse-xml/change-hostdevs-in.xml +++ b/tests/xmlparse-xml/change-hostdevs-in.xml @@ -53,5 +53,10 @@ /dev/net/tun + + + /dev/sdf + + diff --git a/tests/xmlparse-xml/change-hostdevs-out.xml b/tests/xmlparse-xml/change-hostdevs-out.xml index 12733851..7c1fe64a 100644 --- a/tests/xmlparse-xml/change-hostdevs-out.xml +++ b/tests/xmlparse-xml/change-hostdevs-out.xml @@ -56,5 +56,10 @@ /dev/null + + + /dev/fd0 + + diff --git a/tests/xmlparse.py b/tests/xmlparse.py index d99d86ec..6bed133d 100644 --- a/tests/xmlparse.py +++ b/tests/xmlparse.py @@ -697,6 +697,7 @@ class XMLParseTest(unittest.TestCase): dev4 = guest.devices.hostdev[3] dev5 = guest.devices.hostdev[4] dev6 = guest.devices.hostdev[5] + dev7 = guest.devices.hostdev[6] check = self._make_checker(dev1) check("type", "usb", "foo", "usb") @@ -739,6 +740,10 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(dev6) check("type", "misc") check("misc_char", "/dev/net/tun", "/dev/null") + + check = self._make_checker(dev7) + check("type", "storage") + check("storage_block", "/dev/sdf", "/dev/fd0") self._alter_compare(guest.get_xml_config(), outfile) def testAlterWatchdogs(self): diff --git a/virtinst/cli.py b/virtinst/cli.py index 655a1150..c3464d60 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -2785,6 +2785,9 @@ class ParserHostdev(VirtCLIParser): elif inst.type == "misc": inst.mode = "capabilities" inst.misc_char = val + elif inst.type == "storage": + inst.mode = "capabilities" + inst.storage_block = val else: val = NodeDevice.lookupNodedevFromString(inst.conn, val) inst.set_from_nodedev(val) diff --git a/virtinst/devices/hostdev.py b/virtinst/devices/hostdev.py index 5d0364cb..4769b0a2 100644 --- a/virtinst/devices/hostdev.py +++ b/virtinst/devices/hostdev.py @@ -138,3 +138,6 @@ class DeviceHostdev(Device): # type=misc handling misc_char = XMLProperty("./source/char") + + # type=misc handling + storage_block = XMLProperty("./source/block")