[virt-tools-list] [virt-manager] [PATCH 4/7] domain: memorybacking: Add function is_shared_access()

Lin Ma lma at suse.com
Sun Aug 1 12:36:39 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..60e97da4 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_shared_access(self):
+        return self.access_mode == "shared"
-- 
2.26.2





More information about the virt-tools-list mailing list