diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml b/tests/cli-test-xml/compare/virt-install-many-devices.xml index 1cb4b3f47..23ee0fcd1 100644 --- a/tests/cli-test-xml/compare/virt-install-many-devices.xml +++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml @@ -153,7 +153,7 @@ - + diff --git a/tests/clitest.py b/tests/clitest.py index b2d59d9a3..544a1b117 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -498,8 +498,8 @@ c.add_compare(""" \ --hostdev usb_5_20 --hostdev usb_5_21 \ \ ---filesystem /source,/target,mode=squash \ ---filesystem template_name,/,type=template \ +--filesystem /source,/target,accessmode=squash \ +--filesystem template_name,/,type=template,mode=passthrough \ \ --soundhw default \ --sound ac97 \ diff --git a/tests/xmlparse.py b/tests/xmlparse.py index 50452f263..550ea0a9c 100644 --- a/tests/xmlparse.py +++ b/tests/xmlparse.py @@ -743,7 +743,7 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(dev1) check("type", None, "mount") - check("mode", None, "passthrough") + check("accessmode", None, "passthrough") check("driver", "handle", None) check("wrpolicy", None, None) check("source", "/foo/bar", "/new/path") @@ -751,20 +751,20 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(dev2) check("type", "template") - check("mode", None, "mapped") + check("accessmode", None, "mapped") check("source", "template_fedora", "template_new") check("target", "/bar/baz") check = self._make_checker(dev3) check("type", "mount", None) - check("mode", "squash", None) + check("accessmode", "squash", None) check("driver", "path", "handle") check("wrpolicy", "immediate", None) check("readonly", False, True) check = self._make_checker(dev4) check("type", "mount", None) - check("mode", "mapped", None) + check("accessmode", "mapped", None) check("driver", "path", "handle") check("wrpolicy", None, "immediate") check("readonly", False, True) @@ -781,7 +781,7 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(dev7) check("type", "file") - check("mode", "passthrough", None) + check("accessmode", "passthrough", None) check("driver", "nbd", "loop") check("format", "qcow", "raw") check("source", "/foo/bar.img", "/foo/bar.raw") diff --git a/virtManager/fsdetails.py b/virtManager/fsdetails.py index 52bd3b76a..da87ec484 100644 --- a/virtManager/fsdetails.py +++ b/virtManager/fsdetails.py @@ -182,7 +182,7 @@ class vmmFSDetails(vmmGObjectUI): self._dev = dev self.set_config_value("fs-type", dev.type or "default") - self.set_config_value("fs-mode", dev.mode or "default") + self.set_config_value("fs-mode", dev.accessmode or "default") self.set_config_value("fs-driver", dev.driver or "default") self.set_config_value("fs-wrpolicy", dev.wrpolicy or "default") self.set_config_value("fs-format", dev.format or "default") @@ -308,7 +308,7 @@ class vmmFSDetails(vmmGObjectUI): self._dev.source = source self._dev.target = target if mode: - self._dev.mode = mode + self._dev.accessmode = mode if fstype: self._dev.type = fstype if readonly: diff --git a/virtinst/cli.py b/virtinst/cli.py index 6b18d32e7..70baa2a73 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -2198,7 +2198,7 @@ class ParserFilesystem(VirtCLIParser): self.remove_first = ["source", "target"] self.set_param("type", "type") - self.set_param("mode", "mode") + self.set_param("accessmode", "accessmode", aliases=["mode"]) self.set_param("source", "source") self.set_param("target", "target") diff --git a/virtinst/devicefilesystem.py b/virtinst/devicefilesystem.py index 5bde3eada..33be9c2c3 100644 --- a/virtinst/devicefilesystem.py +++ b/virtinst/devicefilesystem.py @@ -32,7 +32,8 @@ class VirtualFilesystem(VirtualDevice): TYPE_BLOCK = "block" TYPE_RAM = "ram" TYPE_DEFAULT = "default" - TYPES = [TYPE_MOUNT, TYPE_TEMPLATE, TYPE_FILE, TYPE_BLOCK, TYPE_RAM, TYPE_DEFAULT] + TYPES = [TYPE_MOUNT, TYPE_TEMPLATE, TYPE_FILE, TYPE_BLOCK, TYPE_RAM, + TYPE_DEFAULT] MODE_PASSTHROUGH = "passthrough" MODE_MAPPED = "mapped" @@ -49,13 +50,14 @@ class VirtualFilesystem(VirtualDevice): DRIVER_LOOP = "loop" DRIVER_NBD = "nbd" DRIVER_DEFAULT = "default" - DRIVERS = [DRIVER_PATH, DRIVER_HANDLE, DRIVER_LOOP, DRIVER_NBD, DRIVER_DEFAULT] + DRIVERS = [DRIVER_PATH, DRIVER_HANDLE, DRIVER_LOOP, DRIVER_NBD, + DRIVER_DEFAULT] type = XMLProperty("./@type", default_cb=lambda s: None, default_name=TYPE_DEFAULT) - mode = XMLProperty("./@accessmode", + accessmode = XMLProperty("./@accessmode", default_cb=lambda s: None, default_name=MODE_DEFAULT) wrpolicy = XMLProperty("./driver/@wrpolicy",