1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

tests: always assume JSON in qemuMonitorTestNew

Now that all the callers call qemuMonitorTestNew with json=true,
remove the argument and always assume JSON.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Ján Tomko 2019-06-14 20:14:23 +02:00
parent 92f130a2e1
commit 6806051078
3 changed files with 10 additions and 14 deletions

View File

@ -280,7 +280,7 @@ testQemuHotplug(const void *data)
/* Now is the best time to feed the spoofed monitor with predefined
* replies. */
if (!(test_mon = qemuMonitorTestNew(true, driver.xmlopt, vm, &driver,
if (!(test_mon = qemuMonitorTestNew(driver.xmlopt, vm, &driver,
NULL, NULL)))
goto cleanup;

View File

@ -1241,11 +1241,8 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test)
"}"
/* We skip the normal handshake reply of "{\"execute\":\"qmp_capabilities\"}" */
#define QEMU_TEXT_GREETING "QEMU 1.0,1 monitor - type 'help' for more information"
qemuMonitorTestPtr
qemuMonitorTestNew(bool json,
virDomainXMLOptionPtr xmlopt,
qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
virDomainObjPtr vm,
virQEMUDriverPtr driver,
const char *greeting,
@ -1259,11 +1256,11 @@ qemuMonitorTestNew(bool json,
if (!(test = qemuMonitorCommonTestNew(xmlopt, vm, &src)))
goto error;
test->json = json;
test->json = true;
test->qapischema = schema;
if (!(test->mon = qemuMonitorOpen(test->vm,
&src,
json,
true,
true,
0,
&qemuMonitorTestCallbacks,
@ -1273,7 +1270,7 @@ qemuMonitorTestNew(bool json,
virObjectLock(test->mon);
if (!greeting)
greeting = json ? QEMU_JSON_GREETING : QEMU_TEXT_GREETING;
greeting = QEMU_JSON_GREETING;
if (qemuMonitorTestAddResponse(test, greeting) < 0)
goto error;
@ -1340,7 +1337,7 @@ qemuMonitorTestNewFromFile(const char *fileName,
goto error;
} else {
/* Create new mocked monitor with our greeting */
if (!(test = qemuMonitorTestNew(true, xmlopt, NULL, NULL,
if (!(test = qemuMonitorTestNew(xmlopt, NULL, NULL,
singleReply, NULL)))
goto error;
}
@ -1425,7 +1422,7 @@ qemuMonitorTestNewFromFileFull(const char *fileName,
if (virTestLoadFile(fileName, &jsonstr) < 0)
return NULL;
if (!(ret = qemuMonitorTestNew(true, driver->xmlopt, vm, driver, NULL,
if (!(ret = qemuMonitorTestNew(driver->xmlopt, vm, driver, NULL,
qmpschema)))
goto cleanup;

View File

@ -75,12 +75,11 @@ int qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test,
const char *response);
# define qemuMonitorTestNewSimple(xmlopt) \
qemuMonitorTestNew(true, xmlopt, NULL, NULL, NULL, NULL)
qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, NULL)
# define qemuMonitorTestNewSchema(xmlopt, schema) \
qemuMonitorTestNew(true, xmlopt, NULL, NULL, NULL, schema)
qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, schema)
qemuMonitorTestPtr qemuMonitorTestNew(bool json,
virDomainXMLOptionPtr xmlopt,
qemuMonitorTestPtr qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
virDomainObjPtr vm,
virQEMUDriverPtr driver,
const char *greeting,