]> xenbits.xensource.com Git - libvirt.git/commitdiff
vsh: Drop conditional error reporting in vshErrorHandler
authorErik Skultety <eskultet@redhat.com>
Wed, 9 Nov 2016 11:20:46 +0000 (12:20 +0100)
committerErik Skultety <eskultet@redhat.com>
Mon, 14 Nov 2016 09:18:56 +0000 (10:18 +0100)
First, since commit 834c5720 the error reporting within the vshErrorHandler
doesn't work because there was a lot of renaming going on (dull mechanical
renaming without much thinking about it, yep - shame on me) and so the original
env variable VIRSH_DEBUG got renamed to VSH_DEBUG which we don't support nor
document anywhere. Second, by specifying this env variable, the last libvirt
error gets reported twice despite the fact we say the error reporting should be
deferred until the command finishes, and last but not least the vintage code's
logic is a bit 'odd', since the error would get reported iff the env variable
is set, even if the value should be equal to our DEFAULT value in which case it
doesn't make sense that we behave differently when an env variable is set to
some value and when there's no env variable at all but we use the same value
automatically as default.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
tools/vsh.c

index 3ba09ddadb2115a940bc69723f86ad60b061e5e0..07ceb7bf5fccb35ddded71aa8e20ee427e8f1dc1 100644 (file)
@@ -246,8 +246,6 @@ vshErrorHandler(void *opaque ATTRIBUTE_UNUSED, virErrorPtr error)
 {
     virFreeError(last_error);
     last_error = virSaveLastError();
-    if (virGetEnvAllowSUID("VSH_DEBUG") != NULL)
-        virDefaultErrorFunc(error);
 }
 
 /* Store a libvirt error that is from a helper API that doesn't raise errors