[virt-tools-list] [PATCH 0/3] virt-viewer: add SIGINT handler

Francesco Giudici fgiudici at redhat.com
Tue Nov 12 11:29:09 UTC 2019


When remote-viewer or virt-viewer are terminated by a signal, they quit
without explicitly releasing resources. A bug[1] has been filed against
virt-viewer for not releasing redirected usb devices when it's terminated
by CTRL-C. Clearly this could be solved by adding a signal handler doing
proper shutdown of the application.
The right way to do this is to manage the application termination in the
main event loop. This has been achieved through the self pipe trick[2].
Windows APIs to manage pipes are different than linux and moreover the
Windows APIs that would integrate well with glib, which are supported by
Mingw build system, seems are not by Microsoft Visual Studio build
environment.
Wondering if it is worth to deal with the SIGINT handler in Windows, as
the use case seems quite remote, and if we support building under Visual
Studio. For this reasons, three separate patches are proposed: the first
one adds the SIGINT handler for linux only, the second one adds support
for Windows and the third one excludes the SIGINT handler compilation
when building with Visual Studio.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1713311
[2] https://cr.yp.to/docs/selfpipe.html

Francesco Giudici (3):
  remote-viewer: add handler for SIGINT signal
  remote-viewer: add Windows support to the SIGINT handler
  remote-viewer: allow to build with Microsoft Visual Studio

 src/virt-viewer-app.c | 97 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)

-- 
2.21.0





More information about the virt-tools-list mailing list