From 546010ff944ba88caa355af2fa4838cedb1eb783 Mon Sep 17 00:00:00 2001 From: Lin Ma Date: Sun, 1 Aug 2021 20:36:37 +0800 Subject: [PATCH] domcapabilities: Add supports_filesystem_virtiofs() Check whether virtiofs is exposed in domcapabilities, We can use it as a proxy for 'libvirt is new enough to allow bare memory access mode=shared' as well. Signed-off-by: Lin Ma --- virtinst/domcapabilities.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py index 995efb109..fe2c955a1 100644 --- a/virtinst/domcapabilities.py +++ b/virtinst/domcapabilities.py @@ -373,6 +373,13 @@ class DomainCapabilities(XMLBuilder): types = self.devices.graphics.get_enum("type").get_values() return bool("spice" in types) + def supports_filesystem_virtiofs(self): + """ + Return True if libvirt advertises support for virtiofs + """ + types = self.devices.filesystem.get_enum("driverType").get_values() + return bool("virtiofs" in types) + XML_NAME = "domainCapabilities" os = XMLChildProperty(_OS, is_single=True)