qemu: make sure agent returns error when required data are missing
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 <e82f23e74d43760279ebcc505dac4ae70d5627d0@redhat.com>

rlaager/libvirt,nertpinx/libvirt,crobinso/libvirt,libvirt/libvirt,nertpinx/libvirt,andreabolognani/libvirt,VenkatDatta/libvirt,nertpinx/libvirt,datto/libvirt,fabianfreyer/libvirt,libvirt/libvirt,elmarco/libvirt,VenkatDatta/libvirt,zippy2/libvirt,jardasgit/libvirt,taget/libvirt,jardasgit/libvirt,nertpinx/libvirt,rlaager/libvirt,crobinso/libvirt,datto/libvirt,andreabolognani/libvirt,libvirt/libvirt,datto/libvirt,VenkatDatta/libvirt,shugaoye/libvirt,jfehlig/libvirt,VenkatDatta/libvirt,agx/libvirt,eskultety/libvirt,elmarco/libvirt,shugaoye/libvirt,zippy2/libvirt,jardasgit/libvirt,shugaoye/libvirt,jardasgit/libvirt,crobinso/libvirt,elmarco/libvirt,andreabolognani/libvirt,taget/libvirt,olafhering/libvirt,taget/libvirt,agx/libvirt,elmarco/libvirt,zippy2/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,agx/libvirt,agx/libvirt,zippy2/libvirt,fabianfreyer/libvirt,datto/libvirt,shugaoye/libvirt,andreabolognani/libvirt,VenkatDatta/libvirt,jfehlig/libvirt,eskultety/libvirt,agx/libvirt,datto/libvirt,elmarco/libvirt,rlaager/libvirt,eskultety/libvirt,libvirt/libvirt,eskultety/libvirt,rlaager/libvirt,olafhering/libvirt,shugaoye/libvirt,jfehlig/libvirt,nertpinx/libvirt,taget/libvirt,crobinso/libvirt,olafhering/libvirt,olafhering/libvirt,taget/libvirt,andreabolognani/libvirt,jardasgit/libvirt,eskultety/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,rlaager/libvirt