]> xenbits.xensource.com Git - libvirt.git/commit
Better error reporting in virsh.
authorChris Lalancette <clalance@redhat.com>
Sat, 3 Apr 2010 01:24:50 +0000 (21:24 -0400)
committerChris Lalancette <clalance@redhat.com>
Tue, 6 Apr 2010 13:48:13 +0000 (09:48 -0400)
commit23b1e5c0b0e0be4e45e96bfb9da2b11e23dce916
treea13353ca185857cfc1f31312a159ff18b171b3d1
parent86fe2ba6dcd31469d6600b24762568a0ba76cd40
Better error reporting in virsh.

When hitting failures in virsh, a common idiom is
to jump to a cleanup label, free some resources, and
then return a FALSE error code to vshCommandRun.
In theory, vshCommandRun is then supposed to print
out the last error.  The problem is that many of
the cleanup paths have library calls to free resources,
and all of those library calls clear out the last error.
This is leading to situations where no error is being
reported at all.

This patch remedies the situation somewhat by
printing out the errors inside the command methods
themselves when we know it will go through a cleanup
path that will lose the error.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
tools/virsh.c