]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMonitorJSONGetMigrationParams: Don't return early on CommandNotFound
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 21 Oct 2021 08:37:17 +0000 (10:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 22 Oct 2021 05:00:44 +0000 (07:00 +0200)
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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_json.c

index 9af9d3cf639f377abee4e635c9f383fc116ee77d..65b5fc04a6e57ffe1c635a9b5420ae73afa19aae 100644 (file)
@@ -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.
  */
index 7bf3a9981bb8ca51c270be32d32952b43e5b4ae6..08cd535045c935a15cd4e278c3c308fcded9d0d9 100644 (file)
@@ -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;