[libvirt] [PATCH] qemu: don't log failure during QMP add-fd probe

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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 686cee9..a86d90c 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -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"); -- 1.8.1

On Tue, Feb 05, 2013 at 08:54:57AM -0700, Eric Blake wrote:
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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 686cee9..a86d90c 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -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");
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 02/05/2013 08:59 AM, Daniel P. Berrange wrote:
On Tue, Feb 05, 2013 at 08:54:57AM -0700, Eric Blake wrote:
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. ---
ACK
Thanks; pushed. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Daniel P. Berrange
-
Eric Blake