libvirt/tools
Eric Blake 35966308b5 virsh: Fix regression with duplicated error messages
Commit 4f4c3b13 (v3.3) fixed an issue where performing cleanup of
libvirt objects could sometimes lose error messages, by adding code
to copy the libvirt error into last_error prior to cleanup paths.
However, it caused a regression: on other paths, some errors are now
printed twice, if libvirt still remembers in its thread-local
storage that an error was set even after virsh cleared last_error.
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@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2018-10-12 09:30:56 -05:00
..
bash-completion tools: Provide bash autompletion file 2018-01-11 18:53:04 +01:00
nss util: Clean up consumers of virJSONValueArraySize 2018-05-10 14:59:15 -04:00
wireshark src: More cleanup of some system headers already contained in internal.h 2018-09-20 10:16:39 +02:00
libvirt_win_icon_16x16.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_32x32.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_48x48.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_64x64.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt-guests.init.in Use https:// links for most sites 2017-10-16 10:22:34 +01:00
libvirt-guests.service.in Use https:// links for most sites 2017-10-16 10:22:34 +01:00
libvirt-guests.sh.in tools: do not report unknown guests in print_guests_shutdown 2018-04-24 10:46:41 +02:00
libvirt-guests.sysconf lxc: allow use of lxc:///system URI as preferred format 2018-04-12 16:52:01 +01:00
Makefile.am vsh: Add API for printing tables. 2018-08-24 10:52:41 +02:00
virsh_win_icon.rc Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
virsh-completer.c New virsh feature: domif-setlink --domain --interface --state completer 2018-07-12 17:23:15 +02:00
virsh-completer.h New virsh feature: domif-setlink --domain --interface --state completer 2018-07-12 17:23:15 +02:00
virsh-console.c src: More cleanup of some system headers already contained in internal.h 2018-09-20 10:16:39 +02:00
virsh-console.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-domain-monitor.c virsh: Implement vshTable API to domiflist 2018-09-24 09:09:14 +02:00
virsh-domain-monitor.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-domain.c virsh: Require explicit --domain for domxml-to-native 2018-09-26 17:22:38 +02:00
virsh-domain.h virsh: Move vshEventCallback structure definition to virsh-domain.h 2018-05-24 13:36:32 +02:00
virsh-edit.c virsh-edit: remove unreachable break 2018-03-08 16:51:31 +01:00
virsh-host.c virsh: Introduce new hypervisor-cpu-baseline command 2018-05-28 15:59:10 +02:00
virsh-host.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-interface.c virsh: Implement vsh-table to iface-list 2018-09-24 09:09:14 +02:00
virsh-interface.h Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00
virsh-network.c virsh: Implement vshTable API to net-list and net-dhcp-leases 2018-09-24 09:09:14 +02:00
virsh-network.h Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00
virsh-nodedev.c virsh: Add event name completion to 'nodedev-event' command 2018-05-24 15:26:10 +02:00
virsh-nodedev.h virsh-nodedev: Rename and move vshEventCallback to virshNodedevEventCallback 2018-05-24 15:26:10 +02:00
virsh-nwfilter.c virsh: Implement vshTable API to nwfilter-list and nwfilterbinding-list 2018-09-24 09:09:14 +02:00
virsh-nwfilter.h virsh: add nwfilter binding commands 2018-06-26 11:22:07 +01:00
virsh-pool.c virsh: Implement vshTable API to pool-list 2018-09-24 09:09:14 +02:00
virsh-pool.h virsh-pool: Rename and move vshEventCallback to virshPoolEventCallback 2018-05-24 15:26:02 +02:00
virsh-secret.c virsh: Implement vshTable API to secret-list 2018-09-24 09:09:14 +02:00
virsh-secret.h virsh-secret: Rename vshEventCallback to virshSecretEventCallback 2018-05-24 13:32:25 +02:00
virsh-snapshot.c virsh: Implement vshTable API to snapshot-list. 2018-09-24 09:09:14 +02:00
virsh-snapshot.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-util.c all: Replace virGetLastError with virGetLastErrorCode where we can 2018-06-05 18:44:05 +02:00
virsh-util.h virsh: Implement sparse stream to vol-upload 2017-05-18 07:42:13 +02:00
virsh-volume.c virsh: Implement vshTable API to vol-list 2018-09-24 09:09:14 +02:00
virsh-volume.h Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00
virsh.c src: More cleanup of some system headers already contained in internal.h 2018-09-20 10:16:39 +02:00
virsh.h virsh: Require explicit --domain for domxml-to-native 2018-09-26 17:22:38 +02:00
virsh.pod nwfilter: Add extra verbiage for binding create/delete 2018-08-24 08:45:19 -04:00
virt-admin-completer.c virt-admin: Introduce vshAdmServerCompleter 2018-01-11 18:53:04 +01:00
virt-admin-completer.h virt-admin: Introduce vshAdmServerCompleter 2018-01-11 18:53:04 +01:00
virt-admin.c tools: Fix printf format 2018-09-24 13:39:58 +02:00
virt-admin.h Revert "admin: Rename virAdmConnect to virAdmDaemon" 2015-12-21 10:07:59 +01:00
virt-admin.pod Use https:// links for most sites 2017-10-16 10:22:34 +01:00
virt-host-validate-bhyve.c internal: Move <stdio.h> include to internal.h 2018-09-20 10:16:38 +02:00
virt-host-validate-bhyve.h virt-host-validate: add bhyve support 2017-03-11 21:22:58 +04:00
virt-host-validate-common.c virt-host-validate: Fix build on non-Linux 2018-10-08 09:55:40 +02:00
virt-host-validate-common.h virt-host-validate: rewrite cgroup detection to use util/vircgroup 2018-10-05 15:53:29 +02:00
virt-host-validate-lxc.c virt-host-validate: require freezer for LXC 2018-10-05 15:53:29 +02:00
virt-host-validate-lxc.h headers: Remove unnecessary keyword extern from function declaration 2016-05-11 09:06:32 +02:00
virt-host-validate-qemu.c virt-host-validate: rewrite cgroup detection to use util/vircgroup 2018-10-05 15:53:29 +02:00
virt-host-validate-qemu.h headers: Remove unnecessary keyword extern from function declaration 2016-05-11 09:06:32 +02:00
virt-host-validate.c src: More cleanup of some system headers already contained in internal.h 2018-09-20 10:16:39 +02:00
virt-host-validate.pod Use https:// links for most sites 2017-10-16 10:22:34 +01:00
virt-login-shell.c src: More cleanup of some system headers already contained in internal.h 2018-09-20 10:16:39 +02:00
virt-login-shell.conf virt-login-shell: add ability to auto-detect shell from container 2016-06-10 11:03:02 +01:00
virt-login-shell.pod Use https:// links for most sites 2017-10-16 10:22:34 +01:00
virt-pki-validate.in fix regex to check CN from server certificate 2018-02-08 18:05:05 +01:00
virt-pki-validate.pod Use https:// links for most sites 2017-10-16 10:22:34 +01:00
virt-sanlock-cleanup.in build: Extract pod from source files 2016-04-25 15:40:43 +02:00
virt-sanlock-cleanup.pod Use https:// links for most sites 2017-10-16 10:22:34 +01:00
virt-xml-validate.in virt-xml-validate: Add schema for nwfilterbinding 2018-07-19 16:16:57 -04:00
virt-xml-validate.pod virt-xml-validate: Add schema for nwfilterbinding 2018-07-19 16:16:57 -04:00
vsh-table.c src: More cleanup of some system headers already contained in internal.h 2018-09-20 10:16:39 +02:00
vsh-table.h vsh: Add API for printing tables. 2018-08-24 10:52:41 +02:00
vsh.c virsh: Fix regression with duplicated error messages 2018-10-12 09:30:56 -05:00
vsh.h src: More cleanup of some system headers already contained in internal.h 2018-09-20 10:16:39 +02:00