mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
devicefilesystem: Rename mode->accessmode
To reflect the name in the XML
This commit is contained in:
parent
a9aca96458
commit
6a9f0089b9
@ -153,7 +153,7 @@
|
|||||||
<source dir="/source"/>
|
<source dir="/source"/>
|
||||||
<target dir="/target"/>
|
<target dir="/target"/>
|
||||||
</filesystem>
|
</filesystem>
|
||||||
<filesystem type="template">
|
<filesystem type="template" accessmode="passthrough">
|
||||||
<source name="template_name"/>
|
<source name="template_name"/>
|
||||||
<target dir="/"/>
|
<target dir="/"/>
|
||||||
</filesystem>
|
</filesystem>
|
||||||
|
@ -498,8 +498,8 @@ c.add_compare(""" \
|
|||||||
--hostdev usb_5_20 --hostdev usb_5_21 \
|
--hostdev usb_5_20 --hostdev usb_5_21 \
|
||||||
\
|
\
|
||||||
|
|
||||||
--filesystem /source,/target,mode=squash \
|
--filesystem /source,/target,accessmode=squash \
|
||||||
--filesystem template_name,/,type=template \
|
--filesystem template_name,/,type=template,mode=passthrough \
|
||||||
\
|
\
|
||||||
--soundhw default \
|
--soundhw default \
|
||||||
--sound ac97 \
|
--sound ac97 \
|
||||||
|
@ -743,7 +743,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
|
|
||||||
check = self._make_checker(dev1)
|
check = self._make_checker(dev1)
|
||||||
check("type", None, "mount")
|
check("type", None, "mount")
|
||||||
check("mode", None, "passthrough")
|
check("accessmode", None, "passthrough")
|
||||||
check("driver", "handle", None)
|
check("driver", "handle", None)
|
||||||
check("wrpolicy", None, None)
|
check("wrpolicy", None, None)
|
||||||
check("source", "/foo/bar", "/new/path")
|
check("source", "/foo/bar", "/new/path")
|
||||||
@ -751,20 +751,20 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
|
|
||||||
check = self._make_checker(dev2)
|
check = self._make_checker(dev2)
|
||||||
check("type", "template")
|
check("type", "template")
|
||||||
check("mode", None, "mapped")
|
check("accessmode", None, "mapped")
|
||||||
check("source", "template_fedora", "template_new")
|
check("source", "template_fedora", "template_new")
|
||||||
check("target", "/bar/baz")
|
check("target", "/bar/baz")
|
||||||
|
|
||||||
check = self._make_checker(dev3)
|
check = self._make_checker(dev3)
|
||||||
check("type", "mount", None)
|
check("type", "mount", None)
|
||||||
check("mode", "squash", None)
|
check("accessmode", "squash", None)
|
||||||
check("driver", "path", "handle")
|
check("driver", "path", "handle")
|
||||||
check("wrpolicy", "immediate", None)
|
check("wrpolicy", "immediate", None)
|
||||||
check("readonly", False, True)
|
check("readonly", False, True)
|
||||||
|
|
||||||
check = self._make_checker(dev4)
|
check = self._make_checker(dev4)
|
||||||
check("type", "mount", None)
|
check("type", "mount", None)
|
||||||
check("mode", "mapped", None)
|
check("accessmode", "mapped", None)
|
||||||
check("driver", "path", "handle")
|
check("driver", "path", "handle")
|
||||||
check("wrpolicy", None, "immediate")
|
check("wrpolicy", None, "immediate")
|
||||||
check("readonly", False, True)
|
check("readonly", False, True)
|
||||||
@ -781,7 +781,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
|
|
||||||
check = self._make_checker(dev7)
|
check = self._make_checker(dev7)
|
||||||
check("type", "file")
|
check("type", "file")
|
||||||
check("mode", "passthrough", None)
|
check("accessmode", "passthrough", None)
|
||||||
check("driver", "nbd", "loop")
|
check("driver", "nbd", "loop")
|
||||||
check("format", "qcow", "raw")
|
check("format", "qcow", "raw")
|
||||||
check("source", "/foo/bar.img", "/foo/bar.raw")
|
check("source", "/foo/bar.img", "/foo/bar.raw")
|
||||||
|
@ -182,7 +182,7 @@ class vmmFSDetails(vmmGObjectUI):
|
|||||||
self._dev = dev
|
self._dev = dev
|
||||||
|
|
||||||
self.set_config_value("fs-type", dev.type or "default")
|
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-driver", dev.driver or "default")
|
||||||
self.set_config_value("fs-wrpolicy", dev.wrpolicy or "default")
|
self.set_config_value("fs-wrpolicy", dev.wrpolicy or "default")
|
||||||
self.set_config_value("fs-format", dev.format 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.source = source
|
||||||
self._dev.target = target
|
self._dev.target = target
|
||||||
if mode:
|
if mode:
|
||||||
self._dev.mode = mode
|
self._dev.accessmode = mode
|
||||||
if fstype:
|
if fstype:
|
||||||
self._dev.type = fstype
|
self._dev.type = fstype
|
||||||
if readonly:
|
if readonly:
|
||||||
|
@ -2198,7 +2198,7 @@ class ParserFilesystem(VirtCLIParser):
|
|||||||
self.remove_first = ["source", "target"]
|
self.remove_first = ["source", "target"]
|
||||||
|
|
||||||
self.set_param("type", "type")
|
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("source", "source")
|
||||||
self.set_param("target", "target")
|
self.set_param("target", "target")
|
||||||
|
|
||||||
|
@ -32,7 +32,8 @@ class VirtualFilesystem(VirtualDevice):
|
|||||||
TYPE_BLOCK = "block"
|
TYPE_BLOCK = "block"
|
||||||
TYPE_RAM = "ram"
|
TYPE_RAM = "ram"
|
||||||
TYPE_DEFAULT = "default"
|
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_PASSTHROUGH = "passthrough"
|
||||||
MODE_MAPPED = "mapped"
|
MODE_MAPPED = "mapped"
|
||||||
@ -49,13 +50,14 @@ class VirtualFilesystem(VirtualDevice):
|
|||||||
DRIVER_LOOP = "loop"
|
DRIVER_LOOP = "loop"
|
||||||
DRIVER_NBD = "nbd"
|
DRIVER_NBD = "nbd"
|
||||||
DRIVER_DEFAULT = "default"
|
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",
|
type = XMLProperty("./@type",
|
||||||
default_cb=lambda s: None,
|
default_cb=lambda s: None,
|
||||||
default_name=TYPE_DEFAULT)
|
default_name=TYPE_DEFAULT)
|
||||||
mode = XMLProperty("./@accessmode",
|
accessmode = XMLProperty("./@accessmode",
|
||||||
default_cb=lambda s: None,
|
default_cb=lambda s: None,
|
||||||
default_name=MODE_DEFAULT)
|
default_name=MODE_DEFAULT)
|
||||||
wrpolicy = XMLProperty("./driver/@wrpolicy",
|
wrpolicy = XMLProperty("./driver/@wrpolicy",
|
||||||
|
Loading…
Reference in New Issue
Block a user