]> 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>
Thu, 3 Apr 2014 07:43:25 +0000 (09:43 +0200)
commit736e017e3608ce4c97ee519a293ff7faecea040d
tree8f1621c0e232cfd11c7eace18fea3d183961d670
parent246317d3d98cf87b2e24932a118ebf2669462242
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>
src/qemu/qemu_agent.c