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

qemu: Add support for max-bandwidth migration parameter

We already support several ways of setting migration bandwidth and this
is not adding another one. With this patch we are able to read and write
this parameter using query-migrate-parameters and migrate-set-parameters
in one call with all other parameters.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 af1d2fe2
......@@ -2607,13 +2607,14 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon,
VIR_DEBUG("compressLevel=%d:%d compressThreads=%d:%d "
"decompressThreads=%d:%d cpuThrottleInitial=%d:%d "
"cpuThrottleIncrement=%d:%d tlsCreds=%s tlsHostname=%s "
"downtimeLimit=%d:%llu",
"maxBandwidth=%d:%llu downtimeLimit=%d:%llu",
params->compressLevel_set, params->compressLevel,
params->compressThreads_set, params->compressThreads,
params->decompressThreads_set, params->decompressThreads,
params->cpuThrottleInitial_set, params->cpuThrottleInitial,
params->cpuThrottleIncrement_set, params->cpuThrottleIncrement,
NULLSTR(params->tlsCreds), NULLSTR(params->tlsHostname),
params->maxBandwidth_set, params->maxBandwidth,
params->downtimeLimit_set, params->downtimeLimit);
QEMU_CHECK_MONITOR_JSON(mon);
......
......@@ -628,6 +628,9 @@ struct _qemuMonitorMigrationParams {
char *tlsCreds;
char *tlsHostname;
bool maxBandwidth_set;
unsigned long long maxBandwidth;
bool downtimeLimit_set;
unsigned long long downtimeLimit;
};
......
......@@ -2706,6 +2706,7 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon,
PARSE_INT(cpuThrottleIncrement, "cpu-throttle-increment");
PARSE_STR(tlsCreds, "tls-creds");
PARSE_STR(tlsHostname, "tls-hostname");
PARSE_ULONG(maxBandwidth, "max-bandwidth");
PARSE_ULONG(downtimeLimit, "downtime-limit");
#undef PARSE_SET
......@@ -2764,6 +2765,7 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon,
APPEND_INT(cpuThrottleIncrement, "cpu-throttle-increment");
APPEND_STR(tlsCreds, "tls-creds");
APPEND_STR(tlsHostname, "tls-hostname");
APPEND_ULONG(maxBandwidth, "max-bandwidth");
APPEND_ULONG(downtimeLimit, "downtime-limit");
#undef APPEND
......
......@@ -1804,6 +1804,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
" \"cpu-throttle-initial\": 20,"
" \"tls-creds\": \"tls0\","
" \"tls-hostname\": \"\","
" \"max-bandwidth\": 1234567890,"
" \"downtime-limit\": 500"
" }"
"}") < 0) {
......@@ -1855,6 +1856,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
CHECK_INT(cpuThrottleIncrement, "cpu-throttle-increment", 10);
CHECK_STR(tlsCreds, "tls-creds", "tls0");
CHECK_STR(tlsHostname, "tls-hostname", "");
CHECK_ULONG(maxBandwidth, "max-bandwidth", 1234567890ULL);
CHECK_ULONG(downtimeLimit, "downtime-limit", 500ULL);
#undef CHECK_NUM
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册