From 7ccc4d52bd341f005b69cf1b08f1290fb686096c Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 27 Sep 2012 15:25:16 +0100 Subject: [PATCH] Fix regression starting QEMU instances without query-events If QEMU reports CommandNotFound for the 'query-events' command, we must treat that as success, returning a zero-length array of events Signed-off-by: Daniel P. Berrange --- src/qemu/qemu_monitor_json.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 2eb1800f6a..166c431634 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4105,8 +4105,13 @@ int qemuMonitorJSONGetEvents(qemuMonitorPtr mon, ret = qemuMonitorJSONCommand(mon, cmd, &reply); - if (ret == 0) + if (ret == 0) { + if (qemuMonitorJSONHasError(reply, "CommandNotFound")) { + ret = 0; + goto cleanup; + } ret = qemuMonitorJSONCheckError(cmd, reply); + } if (ret < 0) goto cleanup; -- GitLab