Subject: virtinst: add external snapshot capability From: Pavel Hrdina phrdina@redhat.com Tue Jan 23 12:02:43 2024 +0100 Date: Mon Mar 25 13:21:50 2024 +0100: Git: 3cde1acbb631687dfae589e121bb5d08785ede88 Signed-off-by: Pavel Hrdina diff --git a/tests/data/capabilities/kvm-x86_64.xml b/tests/data/capabilities/kvm-x86_64.xml index 1ee90751..0c818b50 100644 --- a/tests/data/capabilities/kvm-x86_64.xml +++ b/tests/data/capabilities/kvm-x86_64.xml @@ -194,6 +194,7 @@ + @@ -300,6 +301,7 @@ + @@ -413,6 +415,7 @@ + @@ -488,6 +491,7 @@ + @@ -513,6 +517,7 @@ + @@ -566,6 +571,7 @@ + @@ -619,6 +625,7 @@ + @@ -653,6 +660,7 @@ + @@ -726,6 +734,7 @@ + diff --git a/tests/test_capabilities.py b/tests/test_capabilities.py index 70c9de6f..8fe82b1b 100644 --- a/tests/test_capabilities.py +++ b/tests/test_capabilities.py @@ -51,6 +51,13 @@ def testCapsUtilFuncs(): caps_empty.guest_lookup() +def testGuestCapabilities(): + filename = "kvm-x86_64.xml" + caps = _buildCaps(filename) + + assert caps.guests[0].supports_externalSnapshot() is True + + ############################## # domcapabilities.py testing # ############################## diff --git a/virtinst/capabilities.py b/virtinst/capabilities.py index 5549a65c..24b1aac7 100644 --- a/virtinst/capabilities.py +++ b/virtinst/capabilities.py @@ -97,6 +97,7 @@ class _CapsGuestFeatures(XMLBuilder): pae = XMLProperty("./pae", is_bool=True) acpi = XMLProperty("./acpi/@default", is_onoff=True) apic = XMLProperty("./apic/@default", is_onoff=True) + externalSnapshot = XMLProperty("./externalSnapshot", is_bool=True) class _CapsGuest(XMLBuilder): @@ -166,6 +167,12 @@ class _CapsGuest(XMLBuilder): """ return bool(self.features.apic) + def supports_externalSnapshot(self): + """ + Return True if capabilities report support for external snapshots + """ + return bool(self.features.externalSnapshot) + ############################ # Main capabilities object #