Go to file
Francesco Giudici a724dff8a3 remote-viewer: add handler for SIGINT signal
When remote-viewer is started from terminal, CTRL-C sends a SIGINT
signal to the program causing immediate termination. On linux clients
usb redirected devices are left without any kernel driver attached,
causing them to appear as no more available to the host.
Add a SIGINT handler to allow a clean exit, in particular to allow
the kernel to attach back the host driver.
The issue is present on linux only.

To perform usb device redirection, virt-viewer leverages spice-gtk
library, which in turn relies on usbredir library, which uses libusb.
In order to take control of the usb device the auto-loaded kernel
driver must be detached. This is achieved (in the very end) with
libusb_detach_kernel_driver(). Then the device interfaces can be claimed
with libusb_claim_interface() and get in control to the application.
During normal application termination, the usb channel is teared down,
performing a reset of the usb device and giving back the control of the
device to the kernel (libusb_attach_kernel_driver()).
If the application quits without doing this, the device interfaces will
end up with no driver attached, making them not usable in the host
system.

Note that enabling libusb_set_auto_detach_kernel_driver() does not solve
the issue, as this is just a convenient API from libusb: libusb will
take care of detaching/attaching the driver to the interfaces of the usb
device each time a call to libusb_release_interface() and
libusb_claim_interface() is performed. An unexpected quit of the
application will skip the libusb_release_interface() call too, leaving
the interfaces without any driver attached.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1713311

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Francesco Giudici <fgiudici@redhat.com>
2020-01-17 16:37:52 +00:00
bash-completion Introduce bash completion 2019-06-19 13:42:12 +02:00
build-aux po: minimize & canonicalize translations stored in git 2019-03-12 11:49:41 +00:00
data po: provide custom make rules for po file management 2019-03-12 11:49:38 +00:00
docs docs: fix "make syntaxcheck" 2015-12-01 16:46:07 +01:00
icons Add virt-viewer-usb.png 2014-11-24 14:14:14 +01:00
m4 Introduce bash completion 2019-06-19 13:42:12 +02:00
man remote-viewer: Allow toggling shared clipboard 2019-03-07 19:52:00 +01:00
po po: refresh translations from zanata 2019-12-16 16:03:43 +00:00
src remote-viewer: add handler for SIGINT signal 2020-01-17 16:37:52 +00:00
tests tests: improvements to monitor-mapping test 2017-04-11 15:20:14 -05:00
.gitpublish Add a git-publish configuration file 2019-03-04 10:43:39 +00:00
.mailmap update .mailmap 2012-03-01 16:20:25 +01:00
acinclude.m4 Disable -Wcast-function-type warning 2018-07-27 11:50:07 +01:00
AUTHORS.in Auto-generate AUTHORS file from GIT logs 2013-02-13 15:17:57 +00:00
autogen.sh po: provide custom make rules for po file management 2019-03-12 11:49:38 +00:00
cfg.mk Delete browser plugin entirely 2013-03-13 11:47:42 +00:00
ChangeLog Automatically generate changelog from GIT history during make dist 2011-11-07 12:42:15 +00:00
configure.ac Introduce bash completion 2019-06-19 13:42:12 +02:00
COPYING Added COPYING/INSTALL files 2007-08-15 20:22:40 -04:00
git.mk git.mk: fix copyright line and remove use of -o / -a 2015-11-05 14:22:35 +00:00
GNUmakefile Import GNULIB rules for syntax checking code 2012-02-06 12:42:23 +00:00
intltool-extract.in Add support for i18n of the UI 2010-01-11 16:01:20 +00:00
intltool-merge.in Add support for i18n of the UI 2010-01-11 16:01:20 +00:00
intltool-update.in Add support for i18n of the UI 2010-01-11 16:01:20 +00:00
maint.mk Revert "Don't set LC_ALL=C during build as that breaks python apps" 2017-08-14 11:37:07 +01:00
Makefile.am Introduce bash completion 2019-06-19 13:42:12 +02:00
mingw-virt-viewer.spec.in po: provide custom make rules for po file management 2019-03-12 11:49:38 +00:00
NEWS Update NEWS for 8.0 release 2019-03-01 16:43:57 +00:00
prepare-release.sh spec: Drop %{extra_release} 2018-11-13 10:13:25 +01:00
README.md Bump min spice to 0.35 and address deprecation warnings 2018-07-27 11:50:07 +01:00
virt-viewer.spec.in Introduce bash completion 2019-06-19 13:42:12 +02:00

Virt Viewer

Virt Viewer provides a graphical viewer for the guest OS display. At this time is supports guest OS using the VNC or SPICE protocols. Further protocols may be supported in the future as user demand dictates. The viewer can connect directly to both local and remotely hosted guest OS, optionally using SSL/TLS encryption.

Virt Viewer is the GTK3 application. Virt Viewer 3.0 was the last release that supported GTK2.

Virt Viewer uses the GTK-VNC (>= 0.4.0) widget to provide a display of the VNC protocol, which is available from

https://wiki.gnome.org/Projects/gtk-vnc

Virt Viewer uses the SPICE-GTK (>= 0.35) widget to provide a display of the SPICE protocol, which is available from:

https://www.spice-space.org/download.html

Use of either SPICE-GTK or GTK-VNC can be disabled at time of configure, with --without-gtk-vnc or --without-spice-gtk respectively.

Virt Viewer uses libvirt to lookup information about the guest OS display. This is available from

http://libvirt.org/

Further information about the Virt Viewer application can be found on the Virt Manager website:

http://virt-manager.org/

Feedback should be directed to the mailing list at

http://www.redhat.com/mailman/listinfo/virt-tools-list