提交 f9433ea0 编写于 作者: E Eli Qiao 提交者: Jiri Denemark

qemumonitorjsontest: add test for getting multithread compress params

Signed-off-by: NEli Qiao <liyong.qiao@intel.com>
Signed-off-by: NShaoHe Feng <shaohe.feng@intel.com>
Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
上级 8979c5dd
......@@ -1592,6 +1592,66 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo(const void *data)
return ret;
}
static int
testQemuMonitorJSONqemuMonitorJSONGetMigrationCompression(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt);
qemuMonitorMigrationCompression compress;
int ret = -1;
if (!test)
return -1;
if (qemuMonitorTestAddItem(test, "query-migrate-parameters",
"{"
" \"return\": {"
" \"decompress-threads\": 2,"
" \"compress-threads\": 8,"
" \"compress-level\": 1"
" }"
"}") < 0) {
goto cleanup;
}
if (qemuMonitorJSONGetMigrationCompression(qemuMonitorTestGetMonitor(test),
&compress) < 0)
goto cleanup;
if (!compress.level_set ||
!compress.threads_set ||
!compress.dthreads_set) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
"One of level, threads or dthreads flags is not set");
return -1;
}
if (compress.level != 1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"Invalid decompress-threads: %d, expected 1",
compress.level);
goto cleanup;
}
if (compress.threads != 8) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"Invalid decompress-threads: %d, expected 8",
compress.threads);
goto cleanup;
}
if (compress.dthreads != 2) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"Invalid decompress-threads: %d, expected 2",
compress.dthreads);
goto cleanup;
}
ret = 0;
cleanup:
qemuMonitorTestFree(test);
return ret;
}
static int
testQemuMonitorJSONqemuMonitorJSONGetMigrationCacheSize(const void *data)
{
......@@ -2333,6 +2393,7 @@ mymain(void)
DO_TEST(qemuMonitorJSONGetBlockInfo);
DO_TEST(qemuMonitorJSONGetBlockStatsInfo);
DO_TEST(qemuMonitorJSONGetMigrationCacheSize);
DO_TEST(qemuMonitorJSONGetMigrationCompression);
DO_TEST(qemuMonitorJSONGetMigrationStats);
DO_TEST(qemuMonitorJSONGetChardevInfo);
DO_TEST(qemuMonitorJSONSetBlockIoThrottle);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册