Rework all remaining callers of qemuMonitorSetMigrationCapability to use the new qemuMonitorSetMigrationCapabilities API. Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- src/qemu/qemu_migration.c | 11 ++++++++--- tests/qemumonitorjsontest.c | 16 +++++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 3240e7d67b..6b0c7545a1 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5681,6 +5681,7 @@ qemuMigrationCapsCheck(virQEMUDriverPtr driver, qemuDomainAsyncJob asyncJob) { qemuDomainObjPrivatePtr priv = vm->privateData; + virBitmapPtr migEvent = NULL; char **caps = NULL; char **capStr; int ret = -1; @@ -5715,12 +5716,16 @@ qemuMigrationCapsCheck(virQEMUDriverPtr driver, } if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT)) { + migEvent = virBitmapNew(QEMU_MONITOR_MIGRATION_CAPS_LAST); + if (!migEvent) + goto cleanup; + + ignore_value(virBitmapSetBit(migEvent, QEMU_MONITOR_MIGRATION_CAPS_EVENTS)); + if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) goto cleanup; - rc = qemuMonitorSetMigrationCapability(priv->mon, - QEMU_MONITOR_MIGRATION_CAPS_EVENTS, - true); + rc = qemuMonitorSetMigrationCapabilities(priv->mon, migEvent, migEvent); if (qemuDomainObjExitMonitor(driver, vm) < 0) goto cleanup; diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 0afdc80038..1cad383596 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2229,13 +2229,14 @@ testQemuMonitorJSONqemuMonitorJSONGetTargetArch(const void *data) } static int -testQemuMonitorJSONqemuMonitorJSONGetMigrationCapability(const void *data) +testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabilities(const void *data) { virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt); int ret = -1; const char *cap; char **caps = NULL; + virBitmapPtr bitmap = NULL; const char *reply = "{" " \"return\": [" @@ -2266,15 +2267,20 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapability(const void *data) goto cleanup; } - if (qemuMonitorJSONSetMigrationCapability(qemuMonitorTestGetMonitor(test), - QEMU_MONITOR_MIGRATION_CAPS_XBZRLE, - true) < 0) + bitmap = virBitmapNew(QEMU_MONITOR_MIGRATION_CAPS_LAST); + if (!bitmap) + goto cleanup; + + ignore_value(virBitmapSetBit(bitmap, QEMU_MONITOR_MIGRATION_CAPS_XBZRLE)); + if (qemuMonitorJSONSetMigrationCapabilities(qemuMonitorTestGetMonitor(test), + bitmap, bitmap) < 0) goto cleanup; ret = 0; cleanup: qemuMonitorTestFree(test); virStringListFree(caps); + virBitmapFree(bitmap); return ret; } @@ -2999,7 +3005,7 @@ mymain(void) DO_TEST(qemuMonitorJSONGetChardevInfo); DO_TEST(qemuMonitorJSONSetBlockIoThrottle); DO_TEST(qemuMonitorJSONGetTargetArch); - DO_TEST(qemuMonitorJSONGetMigrationCapability); + DO_TEST(qemuMonitorJSONGetMigrationCapabilities); DO_TEST(qemuMonitorJSONQueryCPUs); DO_TEST(qemuMonitorJSONGetVirtType); DO_TEST(qemuMonitorJSONSendKey); -- 2.17.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list