[virt-tools-list] [virt-manager 3/8] domain: memorybacking: Add function is_access_shared()

Lin Ma lma at suse.com
Wed Jun 30 12:11:01 UTC 2021


It returns true in case the memoryBacking element contains the "shared"
access mode.

Signed-off-by: Lin Ma <lma at suse.com>
---
 virtinst/domain/memorybacking.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/virtinst/domain/memorybacking.py b/virtinst/domain/memorybacking.py
index c883c57d..0fd75b7d 100644
--- a/virtinst/domain/memorybacking.py
+++ b/virtinst/domain/memorybacking.py
@@ -36,3 +36,6 @@ class DomainMemoryBacking(XMLBuilder):
     allocation_mode = XMLProperty("./allocation/@mode")
 
     pages = XMLChildProperty(_HugepagesPage, relative_xpath="./hugepages")
+
+    def is_access_shared(self):
+        return self.access_mode == "shared"
-- 
2.26.2





More information about the virt-tools-list mailing list