]> xenbits.xensource.com Git - libvirt.git/commit
qemu: cleanup error checking on agent replies
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 1 Apr 2014 12:58:56 +0000 (14:58 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 2 Apr 2014 05:47:01 +0000 (07:47 +0200)
commit5b3492fadb6bfddd370e263bf8a6953b1b26116f
treef83b39831693f417922cbe6a67e5ccd0dab18d8b
parent17f826363d66965b6c220f19efe7da9db6345875
qemu: cleanup error checking on agent replies

On all the places where qemuAgentComand() was called, we did a check
for errors in the reply.  Unfortunately, some of the places called
qemuAgentCheckError() without checking for non-null reply which might
have resulted in a crash.

So this patch makes the error-checking part of qemuAgentCommand()
itself, which:

 a) makes it look better,

 b) makes the check mandatory and, most importantly,

 c) checks for the errors if and only if it is appropriate.

This actually fixes a potential crashers when qemuAgentComand()
returned 0, but reply was NULL.  Having said that, it *should* fix the
following bug:

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_agent.c