diff --git a/tests/data/capabilities/kvm-x86_64.xml b/tests/data/capabilities/kvm-x86_64.xml index 1ee90751e..0c818b504 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 70c9de6fb..8fe82b1b3 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 5549a65ce..24b1aac7d 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 #