From 8534008c3633c132627c8b1b38ddfa7acfbbc96b Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 21 Oct 2021 10:37:17 +0200 Subject: [PATCH] qemuMonitorJSONGetMigrationParams: Don't return early on CommandNotFound MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The qemuMonitorJSONGetMigrationParams() function executes 'query-migrate-parameters' command and returns early if QEMU doesn't know the command. Well, the command was introduced in QEMU release 2.4 (specifically in commit v2.4.0-rc0~147^2~3) and since the minimum required version is 2.11.0 we can be sure that the command will always exist. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- src/qemu/qemu_monitor.c | 4 +--- src/qemu/qemu_monitor_json.c | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 9af9d3cf63..65b5fc04a6 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2381,9 +2381,7 @@ qemuMonitorSetMigrationCacheSize(qemuMonitor *mon, * @mon: Pointer to the monitor object. * @params: Where to store migration parameters. * - * If QEMU does not support querying migration parameters, the function will - * set @params to NULL and return 0 (success). The caller is responsible for - * freeing @params. + * The caller is responsible for freeing @params. * * Returns 0 on success, -1 on error. */ diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 7bf3a9981b..08cd535045 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -3281,11 +3281,6 @@ qemuMonitorJSONGetMigrationParams(qemuMonitor *mon, if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) goto cleanup; - if (qemuMonitorJSONHasError(reply, "CommandNotFound")) { - ret = 0; - goto cleanup; - } - if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_OBJECT) < 0) goto cleanup; -- 2.47.2