1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

qemu: Drop giant if statement from qemuMonitorSetMigrationParams

The check can be easily replaced with a simple test in the JSON
implementation and we don't need to update it every time a new parameter
is added.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Jiri Denemark 2017-10-26 22:10:31 +02:00
parent 6bc3d06700
commit 487759126b
2 changed files with 5 additions and 9 deletions

View File

@ -2618,15 +2618,6 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon,
QEMU_CHECK_MONITOR_JSON(mon);
if (!params->compressLevel_set &&
!params->compressThreads_set &&
!params->decompressThreads_set &&
!params->cpuThrottleInitial_set &&
!params->cpuThrottleIncrement_set &&
!params->migrateTLSAlias &&
!params->migrateTLSHostname)
return 0;
return qemuMonitorJSONSetMigrationParams(mon, params);
}

View File

@ -2765,6 +2765,11 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon,
#undef APPEND_INT
#undef APPEND_STR
if (virJSONValueObjectKeysNumber(args) == 0) {
ret = 0;
goto cleanup;
}
if (virJSONValueObjectAppend(cmd, "arguments", args) < 0)
goto cleanup;
args = NULL;