mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
qemumonitorjsontest: Test qemuMonitorJSONGetMigrationCacheSize
This commit is contained in:
1 parent
846fd13dda
commit
1280eb0a9d
1 file changed
+37
@@ -1426,6 +1426,42 @@ cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
testQemuMonitorJSONqemuMonitorJSONGetMigrationCacheSize(const void *data)
|
||||
{
|
||||
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
|
||||
qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt);
|
||||
int ret = -1;
|
||||
unsigned long long cacheSize;
|
||||
|
||||
if (!test)
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorTestAddItem(test, "query-migrate-cache-size",
|
||||
"{"
|
||||
" \"return\": 67108864,"
|
||||
" \"id\": \"libvirt-12\""
|
||||
"}") < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuMonitorJSONGetMigrationCacheSize(qemuMonitorTestGetMonitor(test),
|
||||
&cacheSize) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (cacheSize != 67108864) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"Invalid cacheSize: %llu, expected 67108864",
|
||||
cacheSize);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
qemuMonitorTestFree(test);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
mymain(void)
|
||||
{
|
||||
@@ -1478,6 +1514,7 @@ mymain(void)
|
||||
DO_TEST(qemuMonitorJSONGetBalloonInfo);
|
||||
DO_TEST(qemuMonitorJSONGetBlockInfo);
|
||||
DO_TEST(qemuMonitorJSONGetBlockStatsInfo);
|
||||
DO_TEST(qemuMonitorJSONGetMigrationCacheSize);
|
||||
|
||||
virObjectUnref(xmlopt);
|
||||
|
||||
|
||||
Reference in new issue
Block a user