[virt-tools-list] [RFC virt-viewer] virt-viewer-app: force quit if quit is requested twice
Daniel P. Berrangé
berrange at redhat.com
Fri Nov 1 08:50:22 UTC 2019
On Thu, Oct 31, 2019 at 12:19:17PM +0100, Kevin Pouget wrote:
> The investigation of BZ#1713548 shows that the viewer cannot be closed
> if Spice-GTK does not send the DISCONNECTED signal [1].
>
> This patch allows a 'force-close' if the user requests twice to close
> the app:
>
> 1. The first time, `virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session))` is called, which should trigger the DISCONNECTED signal and close the app. If this fails,
> 2. The second time, the application is closed, no matter the internal state.
>
> See [2] for the patch that introduced the two-step disconnection.
>
> 1: https://gitlab.freedesktop.org/spice/spice-gtk/blob/0c52ce8937c849d8ae32ade1f22ce3a48c56c732/src/spice-session.c#L2322
> 2: https://pagure.io/virt-viewer/c/8ec03e50
> ---
> src/virt-viewer-app.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
If there is a problem causing spice-gtk to not reliably send the DISCONNECTED
signal, we should be fixing spice, rather than hacking around the problem
in apps. If fixing spice-gtk is not possible, then we should not wait for
DISCONNECTED at all, just quit immediately. Exiting the app will close all
the connections anyway and the spice server needs to support cleanup in
this way regardless.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the virt-tools-list
mailing list