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:
parent
6bc3d06700
commit
487759126b
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user