6d3351
From 2d8e0d2cc979534be0149841e8bed07c0a4ba048 Mon Sep 17 00:00:00 2001
6d3351
Message-Id: <2d8e0d2cc979534be0149841e8bed07c0a4ba048@dist-git>
6d3351
From: Jiri Denemark <jdenemar@redhat.com>
6d3351
Date: Thu, 27 Apr 2017 10:38:41 +0200
6d3351
Subject: [PATCH] qemu: Ignore missing query-migrate-parameters
6d3351
6d3351
Migration with old QEMU which does not support query-migrate-parameters
6d3351
would fail because the QMP command is called unconditionally since the
6d3351
introduction of TLS migration. Previously it was only called if the user
6d3351
explicitly requested a feature which uses QEMU migration parameters. And
6d3351
even then the situation was not ideal, instead of reporting an
6d3351
unsupported feature we'd just complain about missing QMP command.
6d3351
6d3351
Trivially no migration parameters are supported when
6d3351
query-migrate-parameters QMP command is missing. There's no need to
6d3351
report an error if it is missing, the callers will report better error
6d3351
if needed.
6d3351
6d3351
https://bugzilla.redhat.com/show_bug.cgi?id=1441934
6d3351
6d3351
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6d3351
(cherry picked from commit ac58c036065ff1d53bc05b796093287c27c71762)
6d3351
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6d3351
---
6d3351
 src/qemu/qemu_monitor_json.c | 5 +++++
6d3351
 1 file changed, 5 insertions(+)
6d3351
6d3351
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
6d3351
index 405f79fec..601aa3e74 100644
6d3351
--- a/src/qemu/qemu_monitor_json.c
6d3351
+++ b/src/qemu/qemu_monitor_json.c
6d3351
@@ -2666,6 +2666,11 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon,
6d3351
     if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
6d3351
         goto cleanup;
6d3351
 
6d3351
+    if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
6d3351
+        ret = 0;
6d3351
+        goto cleanup;
6d3351
+    }
6d3351
+
6d3351
     if (qemuMonitorJSONCheckError(cmd, reply) < 0)
6d3351
         goto cleanup;
6d3351
 
6d3351
-- 
6d3351
2.12.2
6d3351