mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
qemu: Add support for setting downtime-limit migration parameter
We already support setting the maximum downtime with a dedicated virDomainMigrateSetMaxDowntime API. This patch does not implement another way of setting the downtime by adding a new public migration parameter. It just makes sure any parameter we are able to get from a QEMU monitor by query-migrate-parameters can be passed back to QEMU via migrate-set-parameters. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
9b5d1bd2e3
commit
2384b6f019
@ -2607,14 +2607,15 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon,
|
||||
VIR_DEBUG("compressLevel=%d:%d compressThreads=%d:%d "
|
||||
"decompressThreads=%d:%d cpuThrottleInitial=%d:%d "
|
||||
"cpuThrottleIncrement=%d:%d tlsAlias=%s "
|
||||
"tlsHostname=%s",
|
||||
"tlsHostname=%s 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->migrateTLSAlias),
|
||||
NULLSTR(params->migrateTLSHostname));
|
||||
NULLSTR(params->migrateTLSHostname),
|
||||
params->downtimeLimit_set, params->downtimeLimit);
|
||||
|
||||
QEMU_CHECK_MONITOR_JSON(mon);
|
||||
|
||||
|
@ -2753,6 +2753,10 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon,
|
||||
APPEND(params->VAR, \
|
||||
virJSONValueObjectAppendString, VAR, FIELD)
|
||||
|
||||
#define APPEND_ULONG(VAR, FIELD) \
|
||||
APPEND(params->VAR ## _set, \
|
||||
virJSONValueObjectAppendNumberUlong, VAR, FIELD)
|
||||
|
||||
APPEND_INT(compressLevel, "compress-level");
|
||||
APPEND_INT(compressThreads, "compress-threads");
|
||||
APPEND_INT(decompressThreads, "decompress-threads");
|
||||
@ -2760,10 +2764,12 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon,
|
||||
APPEND_INT(cpuThrottleIncrement, "cpu-throttle-increment");
|
||||
APPEND_STR(migrateTLSAlias, "tls-creds");
|
||||
APPEND_STR(migrateTLSHostname, "tls-hostname");
|
||||
APPEND_ULONG(downtimeLimit, "downtime-limit");
|
||||
|
||||
#undef APPEND
|
||||
#undef APPEND_INT
|
||||
#undef APPEND_STR
|
||||
#undef APPEND_ULONG
|
||||
|
||||
if (virJSONValueObjectKeysNumber(args) == 0) {
|
||||
ret = 0;
|
||||
|
@ -1803,7 +1803,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
|
||||
" \"compress-level\": 1,"
|
||||
" \"cpu-throttle-initial\": 20,"
|
||||
" \"tls-creds\": \"tls0\","
|
||||
" \"tls-hostname\": \"\""
|
||||
" \"tls-hostname\": \"\","
|
||||
" \"downtime-limit\": 500"
|
||||
" }"
|
||||
"}") < 0) {
|
||||
goto cleanup;
|
||||
@ -1830,6 +1831,9 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
|
||||
#define CHECK_INT(VAR, FIELD, VALUE) \
|
||||
CHECK_NUM(VAR, FIELD, VALUE, "%d")
|
||||
|
||||
#define CHECK_ULONG(VAR, FIELD, VALUE) \
|
||||
CHECK_NUM(VAR, FIELD, VALUE, "%llu")
|
||||
|
||||
#define CHECK_STR(VAR, FIELD, VALUE) \
|
||||
do { \
|
||||
if (!params.VAR) { \
|
||||
@ -1851,9 +1855,11 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
|
||||
CHECK_INT(cpuThrottleIncrement, "cpu-throttle-increment", 10);
|
||||
CHECK_STR(migrateTLSAlias, "tls-creds", "tls0");
|
||||
CHECK_STR(migrateTLSHostname, "tls-hostname", "");
|
||||
CHECK_ULONG(downtimeLimit, "downtime-limit", 500ULL);
|
||||
|
||||
#undef CHECK_NUM
|
||||
#undef CHECK_INT
|
||||
#undef CHECK_ULONG
|
||||
#undef CHECK_STR
|
||||
|
||||
ret = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user