From: Daniel P. Berrange Date: Thu, 27 Sep 2012 14:25:16 +0000 (+0100) Subject: Fix regression starting QEMU instances without query-events X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7ccc4d52bd341f005b69cf1b08f1290fb686096c;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git 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 --- diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 2eb1800f6..166c43163 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;