mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00: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:
parent
92f130a2e1
commit
6806051078
@ -280,7 +280,7 @@ testQemuHotplug(const void *data)
|
|||||||
|
|
||||||
/* Now is the best time to feed the spoofed monitor with predefined
|
/* Now is the best time to feed the spoofed monitor with predefined
|
||||||
* replies. */
|
* replies. */
|
||||||
if (!(test_mon = qemuMonitorTestNew(true, driver.xmlopt, vm, &driver,
|
if (!(test_mon = qemuMonitorTestNew(driver.xmlopt, vm, &driver,
|
||||||
NULL, NULL)))
|
NULL, NULL)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
@ -1241,11 +1241,8 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test)
|
|||||||
"}"
|
"}"
|
||||||
/* We skip the normal handshake reply of "{\"execute\":\"qmp_capabilities\"}" */
|
/* 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
|
qemuMonitorTestPtr
|
||||||
qemuMonitorTestNew(bool json,
|
qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
|
||||||
virDomainXMLOptionPtr xmlopt,
|
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
virQEMUDriverPtr driver,
|
virQEMUDriverPtr driver,
|
||||||
const char *greeting,
|
const char *greeting,
|
||||||
@ -1259,11 +1256,11 @@ qemuMonitorTestNew(bool json,
|
|||||||
if (!(test = qemuMonitorCommonTestNew(xmlopt, vm, &src)))
|
if (!(test = qemuMonitorCommonTestNew(xmlopt, vm, &src)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
test->json = json;
|
test->json = true;
|
||||||
test->qapischema = schema;
|
test->qapischema = schema;
|
||||||
if (!(test->mon = qemuMonitorOpen(test->vm,
|
if (!(test->mon = qemuMonitorOpen(test->vm,
|
||||||
&src,
|
&src,
|
||||||
json,
|
true,
|
||||||
true,
|
true,
|
||||||
0,
|
0,
|
||||||
&qemuMonitorTestCallbacks,
|
&qemuMonitorTestCallbacks,
|
||||||
@ -1273,7 +1270,7 @@ qemuMonitorTestNew(bool json,
|
|||||||
virObjectLock(test->mon);
|
virObjectLock(test->mon);
|
||||||
|
|
||||||
if (!greeting)
|
if (!greeting)
|
||||||
greeting = json ? QEMU_JSON_GREETING : QEMU_TEXT_GREETING;
|
greeting = QEMU_JSON_GREETING;
|
||||||
|
|
||||||
if (qemuMonitorTestAddResponse(test, greeting) < 0)
|
if (qemuMonitorTestAddResponse(test, greeting) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
@ -1340,7 +1337,7 @@ qemuMonitorTestNewFromFile(const char *fileName,
|
|||||||
goto error;
|
goto error;
|
||||||
} else {
|
} else {
|
||||||
/* Create new mocked monitor with our greeting */
|
/* Create new mocked monitor with our greeting */
|
||||||
if (!(test = qemuMonitorTestNew(true, xmlopt, NULL, NULL,
|
if (!(test = qemuMonitorTestNew(xmlopt, NULL, NULL,
|
||||||
singleReply, NULL)))
|
singleReply, NULL)))
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -1425,7 +1422,7 @@ qemuMonitorTestNewFromFileFull(const char *fileName,
|
|||||||
if (virTestLoadFile(fileName, &jsonstr) < 0)
|
if (virTestLoadFile(fileName, &jsonstr) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!(ret = qemuMonitorTestNew(true, driver->xmlopt, vm, driver, NULL,
|
if (!(ret = qemuMonitorTestNew(driver->xmlopt, vm, driver, NULL,
|
||||||
qmpschema)))
|
qmpschema)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
@ -75,12 +75,11 @@ int qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test,
|
|||||||
const char *response);
|
const char *response);
|
||||||
|
|
||||||
# define qemuMonitorTestNewSimple(xmlopt) \
|
# define qemuMonitorTestNewSimple(xmlopt) \
|
||||||
qemuMonitorTestNew(true, xmlopt, NULL, NULL, NULL, NULL)
|
qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, NULL)
|
||||||
# define qemuMonitorTestNewSchema(xmlopt, schema) \
|
# define qemuMonitorTestNewSchema(xmlopt, schema) \
|
||||||
qemuMonitorTestNew(true, xmlopt, NULL, NULL, NULL, schema)
|
qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, schema)
|
||||||
|
|
||||||
qemuMonitorTestPtr qemuMonitorTestNew(bool json,
|
qemuMonitorTestPtr qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
|
||||||
virDomainXMLOptionPtr xmlopt,
|
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
virQEMUDriverPtr driver,
|
virQEMUDriverPtr driver,
|
||||||
const char *greeting,
|
const char *greeting,
|
||||||
|
Loading…
Reference in New Issue
Block a user