• C
    Better error reporting in virsh. · 23b1e5c0
    Chris Lalancette 提交于
    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: NChris Lalancette <clalance@redhat.com>
    23b1e5c0
virsh.c 279.9 KB