]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: don't override earlier json error
authorEric Blake <eblake@redhat.com>
Fri, 22 Feb 2013 16:41:38 +0000 (09:41 -0700)
committerEric Blake <eblake@redhat.com>
Tue, 26 Feb 2013 00:36:03 +0000 (17:36 -0700)
commit29424d1acd5a0c2e77d8d99372ee531bfe57d36a
tree0c4602952963a504ec1ea8b45cfd42a0dae55d3d
parent34f1a618a5c4507f27f3f467b723c9119c1db3c7
qemu: don't override earlier json error

I built without yajl support, and noticed a strange failure message
in qemumonitorjsontest:

2013-02-22 16:12:37.503+0000: 19812: error : virJSONValueToString:1119 : internal error No JSON parser implementation is available
2013-02-22 16:12:37.503+0000: 19812: error : qemuMonitorJSONCommandWithFd:253 : out of memory

While a later patch will fix the test to skip when json is not present,
this patch avoids overriding the more useful error message from
virJSONValueToString returning NULL.

* src/qemu/qemu_monitor_json.c (qemuMonitorJSONCommandWithFd):
Don't override message.
(qemuMonitorJSONCheckError): Don't print NULL.
* src/qemu/qemu_agent.c (qemuAgentCommand): Don't override message.
(qemuAgentCheckError): Don't print NULL.
(qemuAgentArbitraryCommand): Properly fail on OOM.
src/qemu/qemu_agent.c
src/qemu/qemu_monitor_json.c