提交 1f8a1a95 编写于 作者: J Jiri Denemark

qemu: Do not use qemuMonitorSetMigrationCapability

Rework all remaining callers of qemuMonitorSetMigrationCapability to use
the new qemuMonitorSetMigrationCapabilities API.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 0801e0e3
......@@ -487,6 +487,7 @@ qemuMigrationCapsCheck(virQEMUDriverPtr driver,
int asyncJob)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virBitmapPtr migEvent = NULL;
char **caps = NULL;
char **capStr;
int ret = -1;
......@@ -521,12 +522,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;
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册