]> git.ipfire.org Git - thirdparty/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, 9 Apr 2014 16:38:47 +0000 (18:38 +0200)
commit8aaa2c4086dd2df555044327ae08083778d39a82
treec8dc7ae870c11dae455c4c67087c1902a7b3f297
parent5003b7c7986c11b6a061ddb62945094194054428
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>
(cherry picked from commit 5b3492fadb6bfddd370e263bf8a6953b1b26116f)

Conflicts:
src/qemu/qemu_agent.c -- vCPU functions (3099c063)
src/qemu/qemu_agent.c