mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-31 18:15:25 +00:00
qemumonitorjsontest: Test more migration capabilities
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
8d00f3e801
commit
8cd5edfdfe
@ -2044,7 +2044,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabilities(const void *opaque)
|
|||||||
{
|
{
|
||||||
const testGenericData *data = opaque;
|
const testGenericData *data = opaque;
|
||||||
virDomainXMLOption *xmlopt = data->xmlopt;
|
virDomainXMLOption *xmlopt = data->xmlopt;
|
||||||
const char *cap;
|
size_t cap;
|
||||||
g_auto(GStrv) caps = NULL;
|
g_auto(GStrv) caps = NULL;
|
||||||
g_autoptr(virBitmap) bitmap = NULL;
|
g_autoptr(virBitmap) bitmap = NULL;
|
||||||
g_autoptr(virJSONValue) json = NULL;
|
g_autoptr(virJSONValue) json = NULL;
|
||||||
@ -2054,6 +2054,10 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabilities(const void *opaque)
|
|||||||
" {"
|
" {"
|
||||||
" \"state\": false,"
|
" \"state\": false,"
|
||||||
" \"capability\": \"xbzrle\""
|
" \"capability\": \"xbzrle\""
|
||||||
|
" },"
|
||||||
|
" {"
|
||||||
|
" \"state\": true,"
|
||||||
|
" \"capability\": \"events\""
|
||||||
" }"
|
" }"
|
||||||
" ],"
|
" ],"
|
||||||
" \"id\": \"libvirt-22\""
|
" \"id\": \"libvirt-22\""
|
||||||
@ -2072,12 +2076,26 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabilities(const void *opaque)
|
|||||||
&caps) < 0)
|
&caps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
cap = qemuMigrationCapabilityTypeToString(QEMU_MIGRATION_CAP_XBZRLE);
|
for (cap = 0; cap < QEMU_MIGRATION_CAP_LAST; cap++) {
|
||||||
if (!g_strv_contains((const char **) caps, cap)) {
|
const char *capStr = qemuMigrationCapabilityTypeToString(cap);
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
bool present = g_strv_contains((const char **) caps, capStr);
|
||||||
"Expected capability %s is missing", cap);
|
|
||||||
|
switch (cap) {
|
||||||
|
case QEMU_MIGRATION_CAP_XBZRLE:
|
||||||
|
case QEMU_MIGRATION_CAP_EVENTS:
|
||||||
|
if (!present) {
|
||||||
|
VIR_TEST_VERBOSE("Expected capability %s is missing", capStr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (present) {
|
||||||
|
VIR_TEST_VERBOSE("Unexpected capability %s found", capStr);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bitmap = virBitmapNew(QEMU_MIGRATION_CAP_LAST);
|
bitmap = virBitmapNew(QEMU_MIGRATION_CAP_LAST);
|
||||||
ignore_value(virBitmapSetBit(bitmap, QEMU_MIGRATION_CAP_XBZRLE));
|
ignore_value(virBitmapSetBit(bitmap, QEMU_MIGRATION_CAP_XBZRLE));
|
||||||
|
Loading…
Reference in New Issue
Block a user