[libvirt] [PATCH] virsh: Fix regression with duplicated error messages

Michal Privoznik mprivozn at redhat.com
Fri Oct 12 12:24:55 UTC 2018


On 10/11/2018 10:09 PM, Eric Blake wrote:
> Commit 4f4c3b13 (v3.3) fixed an issue where cleaning libvirt objects
> lost error messages, by adding code to copy the libvirt error into
> last_error prior to cleanup paths.  However, it caused a regression:
> some errors are now printed twice, because libvirt still remembers in
> its thread-local storage that an error was set.  For example:
> 
> $ virsh -c test:///default snapshot-delete test blah
> error: Domain snapshot not found: no domain snapshot with matching name 'blah'
> error: Domain snapshot not found: no domain snapshot with matching name 'blah'
> 
> Fix things by telling libvirt to discard any thread-local errors at
> the same time virsh prints an error message (whether or not the libvirt
> error is the same as what is stored in last_error).
> 
> Update the virsh-undefine testsuite (partially reverting portions of
> commit b620bdee, by removing -q, to more easily pinpoint which commands
> are causing which messages), now that there is only one error message
> instead of two.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  tests/virsh-undefine | 20 ++++++++++++++++----
>  tools/vsh.c          |  1 +
>  2 files changed, 17 insertions(+), 4 deletions(-)

ACK

Michal




More information about the libvir-list mailing list