]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Fix regression starting QEMU instances without query-events
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 27 Sep 2012 14:25:16 +0000 (15:25 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 27 Sep 2012 16:39:39 +0000 (17:39 +0100)
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 <berrange@redhat.com>
src/qemu/qemu_monitor_json.c

index 2eb1800f6a1d71922b38fc6afbce12a4439757c9..166c431634edd56f3fde3ad80df17aa065668369 100644 (file)
@@ -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;