]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: make sure agent returns error when required data are missing
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 3 Apr 2014 05:20:25 +0000 (07:20 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 9 Apr 2014 16:45:07 +0000 (18:45 +0200)
commitf85238add2181869cf06768f0bb8aeeff35052a8
treea3affb7bc8d6f14e1409f2e8ae509056938c2609
parent143eb968512e7201013bb2ca9c204888600fc264
qemu: make sure agent returns error when required data are missing

Commit 5b3492fa aimed to fix this and caught one error but exposed
another one.  When agent command is being executed and the thread
waiting for the reply is woken up by an event (e.g. EOF in case of
shutdown), the command finishes with no data (rxObject == NULL), but
no error is reported, since this might be desired by the caller
(e.g. suspend through agent).  However, in other situations, when the
data are required (e.g. getting vCPUs), we proceed to getting desired
data out of the reply, but none of the virJSON*() functions works well
with NULLs.  I chose the way of a new parameter for qemuAgentCommand()
function that specifies whether reply is required and behaves
according to that.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1058149

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit 736e017e3608ce4c97ee519a293ff7faecea040d)
src/qemu/qemu_agent.c