]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: don't log failure during QMP add-fd probe
authorEric Blake <eblake@redhat.com>
Tue, 5 Feb 2013 15:50:00 +0000 (08:50 -0700)
committerEric Blake <eblake@redhat.com>
Tue, 5 Feb 2013 17:46:12 +0000 (10:46 -0700)
Otherwise, we get a lot of scary (but harmless) noise in the logs:

2013-02-05 15:35:48.555+0000: 8637: error : qemuMonitorJSONCheckError:353 : internal error unable to execute QEMU command 'add-fd': Parameter 'fdset-id' expects an existing fdset-id

one for every qemu 1.2 binary that we probe.

* src/qemu/qemu_monitor_json.c (qemuMonitorJSONAddFd): During
probe, avoid logging failures.

src/qemu/qemu_monitor_json.c

index 686cee9adfa33bdeb30f92bf95d67bea698b4cc7..a86d90c4b934e20646473c8646b9f5be9f071866 100644 (file)
@@ -2660,8 +2660,16 @@ qemuMonitorJSONAddFd(qemuMonitorPtr mon, int fdset, int fd, const char *name)
 
     ret = qemuMonitorJSONCommandWithFd(mon, cmd, fd, &reply);
 
-    if (ret == 0)
+    if (ret == 0) {
+        /* qemu 1.2 lacks the functionality we need; but we have to
+         * probe to find that out.  Don't log errors in that case.  */
+        if (STREQ_NULLABLE(name, "/dev/null") &&
+            qemuMonitorJSONHasError(reply, "GenericError")) {
+            ret = -2;
+            goto cleanup;
+        }
         ret = qemuMonitorJSONCheckError(cmd, reply);
+    }
     if (ret == 0) {
         virJSONValuePtr data = virJSONValueObjectGet(reply, "return");