提交 85a3eb8a 编写于 作者: F Francesco Romani 提交者: Michal Privoznik

qemu: export disk snapshot support in capabilities

This patch adds an element to QEMU's capability XML, to
show if the underlying QEMU binary supports the live disk
snapshotting or not.
This allows any client to know ahead of time if the feature
is available.

Without this information available, the only way to check
for the snapshot support is to request one and check for
errors.
Signed-off-by: NFrancesco Romani <fromani@redhat.com>
上级 97814d8a
......@@ -371,6 +371,12 @@
<empty/>
</element>
</optional>
<optional>
<element name='disksnapshot'>
<ref name='featuretoggle'/>
<empty/>
</element>
</optional>
</interleave>
</element>
</define>
......
......@@ -702,6 +702,7 @@ virQEMUCapsInitGuest(virCapsPtr caps,
virQEMUCapsPtr qemubinCaps = NULL;
virQEMUCapsPtr kvmbinCaps = NULL;
int ret = -1;
bool hasdisksnapshot = false;
/* Check for existence of base emulator, or alternate base
* which can be used with magic cpu choice
......@@ -789,6 +790,12 @@ virQEMUCapsInitGuest(virCapsPtr caps,
!virCapabilitiesAddGuestFeature(guest, "deviceboot", 1, 0))
goto error;
if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_DISK_SNAPSHOT))
hasdisksnapshot = true;
if (!virCapabilitiesAddGuestFeature(guest, "disksnapshot", hasdisksnapshot, 0))
goto error;
if (virCapabilitiesAddGuestDomain(guest,
"qemu",
NULL,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册