[virt-tools-list] [virt-viewer] spice: avoid crashing when using multi-seat
Pavel Grunt
pgrunt at redhat.com
Tue Mar 15 16:03:10 UTC 2016
On Tue, 2016-03-15 at 16:51 +0100, Fabiano Fidêncio wrote:
> As multi-seat configuration is not supported by spice, the best we
> can
> do for now is avoid crashing on this setup.
>
> Resolves: rhbz#1250820
>
> Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
> ---
> src/virt-viewer-session-spice.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-
> session-spice.c
> index dc0c1ff..a3014a8 100644
> --- a/src/virt-viewer-session-spice.c
> +++ b/src/virt-viewer-session-spice.c
> @@ -836,8 +836,11 @@ static void
> destroy_display(gpointer data)
> {
> VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(data);
> - VirtViewerSession *session =
> virt_viewer_display_get_session(display);
> + VirtViewerSession *session;
>
> + g_return_if_fail (display != NULL);
> +
> + session = virt_viewer_display_get_session(display);
> g_debug("Destroying spice display %p", display);
> virt_viewer_session_remove_display(session, display);
> g_object_unref(display);
> @@ -886,6 +889,9 @@
> virt_viewer_session_spice_display_monitors(SpiceChannel *channel,
> display = g_ptr_array_index(displays, i);
> if (display == NULL) {
> display = virt_viewer_display_spice_new(self, channel,
> i);
> + if (display == NULL)
> + continue;
> +
> g_debug("creating spice display (#:%d)",
> virt_viewer_display_get_nth(VIRT_VIEWER_DISPLAY(
> display)));
> g_ptr_array_index(displays, i) =
> g_object_ref_sink(display);
More information about the virt-tools-list
mailing list