提交 abaa1100 编写于 作者: J Jiri Denemark

qemu: Add support for cpu throttling parameters

Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 8d58952b
......@@ -2173,16 +2173,21 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon,
qemuMonitorMigrationParamsPtr params)
{
VIR_DEBUG("compressLevel=%d:%d compressThreads=%d:%d "
"decompressThreads=%d:%d",
"decompressThreads=%d:%d cpuThrottleInitial=%d:%d "
"cpuThrottleIncrement=%d:%d",
params->compressLevel_set, params->compressLevel,
params->compressThreads_set, params->compressThreads,
params->decompressThreads_set, params->decompressThreads);
params->decompressThreads_set, params->decompressThreads,
params->cpuThrottleInitial_set, params->cpuThrottleInitial,
params->cpuThrottleIncrement_set, params->cpuThrottleIncrement);
QEMU_CHECK_MONITOR_JSON(mon);
if (!params->compressLevel_set &&
!params->compressThreads_set &&
!params->decompressThreads_set)
!params->decompressThreads_set &&
!params->cpuThrottleInitial_set &&
!params->cpuThrottleIncrement_set)
return 0;
return qemuMonitorJSONSetMigrationParams(mon, params);
......
......@@ -496,6 +496,12 @@ struct _qemuMonitorMigrationParams {
bool decompressThreads_set;
int decompressThreads;
bool cpuThrottleInitial_set;
int cpuThrottleInitial;
bool cpuThrottleIncrement_set;
int cpuThrottleIncrement;
};
int qemuMonitorGetMigrationParams(qemuMonitorPtr mon,
......
......@@ -2560,6 +2560,8 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon,
PARSE(compressLevel, "compress-level");
PARSE(compressThreads, "compress-threads");
PARSE(decompressThreads, "decompress-threads");
PARSE(cpuThrottleInitial, "cpu-throttle-initial");
PARSE(cpuThrottleIncrement, "cpu-throttle-increment");
#undef PARSE
......@@ -2600,6 +2602,8 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon,
APPEND(compressLevel, "compress-level");
APPEND(compressThreads, "compress-threads");
APPEND(decompressThreads, "decompress-threads");
APPEND(cpuThrottleInitial, "cpu-throttle-initial");
APPEND(cpuThrottleIncrement, "cpu-throttle-increment");
#undef APPEND
......
......@@ -1630,8 +1630,10 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
"{"
" \"return\": {"
" \"decompress-threads\": 2,"
" \"cpu-throttle-increment\": 10,"
" \"compress-threads\": 8,"
" \"compress-level\": 1"
" \"compress-level\": 1,"
" \"cpu-throttle-initial\": 20"
" }"
"}") < 0) {
goto cleanup;
......@@ -1658,6 +1660,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
CHECK(compressLevel, "compress-level", 1);
CHECK(compressThreads, "compress-threads", 8);
CHECK(decompressThreads, "decompress-threads", 2);
CHECK(cpuThrottleInitial, "cpu-throttle-initial", 20);
CHECK(cpuThrottleIncrement, "cpu-throttle-increment", 10);
#undef CHECK
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册