[virt-tools-list] [PATCH virt-viewer v2] virt-viewer: Ensure to not close during migration
Daniel P. Berrange
berrange at redhat.com
Thu May 18 11:31:23 UTC 2017
On Thu, May 18, 2017 at 11:59:18AM +0200, Pavel Grunt wrote:
> Take a look at the shutdown event detail before killing
> the connection. Otherwise it breaks the SPICE seamless migration
> feature.
>
> Regression since commit a62827d28c6b69e90102e4c1c8043cbddad8929a
>
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1442929
> Signed-off-by: Pavel Grunt <pgrunt at redhat.com>
> ---
> src/virt-viewer.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/src/virt-viewer.c b/src/virt-viewer.c
> index 3b96534..5c321db 100644
> --- a/src/virt-viewer.c
> +++ b/src/virt-viewer.c
> @@ -52,6 +52,10 @@
> #include "virt-viewer-auth.h"
> #include "virt-viewer-util.h"
>
> +#ifdef HAVE_SPICE_GTK
> +#include "virt-viewer-session-spice.h"
> +#endif
> +
> struct _VirtViewerPrivate {
> char *uri;
> virConnectPtr conn;
> @@ -737,6 +741,13 @@ virt_viewer_domain_event(virConnectPtr conn G_GNUC_UNUSED,
> switch (event) {
> case VIR_DOMAIN_EVENT_STOPPED:
> session = virt_viewer_app_get_session(app);
> +#ifdef HAVE_SPICE_GTK
> + /* do not disconnect due to migration */
> + if (detail == VIR_DOMAIN_EVENT_STOPPED_MIGRATED &&
> + VIRT_VIEWER_IS_SESSION_SPICE(session)) {
> + break;
> + }
> +#endif
> if (session != NULL)
> virt_viewer_session_close(session);
> break;
ACK
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