[Spice-devel] [PATCH 1/2] Modify X interfaces to better enable Xorg resets.

Hans de Goede hdegoede at redhat.com
Sat May 4 02:15:34 PDT 2013


Hi,

Looks good ACK series.

Regards,

Hans


On 05/02/2013 01:44 AM, Jeremy White wrote:
> However, it still crashes, most likely due to the xorg_timer
> in the watch structure.  Those timers become invalid at Xorg
> server reset (it clears all timers), but we go on to continue
> to use them.
>
> As fixing this fully will likely require some messy rework,
> simply documenting -noreset seems like the best choice for now.
>
> Signed-off-by: Jeremy White<jwhite at codeweavers.com>
> ---
>   src/qxl_driver.c         |   14 +++++++++++++-
>   src/spiceqxl_main_loop.c |    6 +++++-
>   src/spiceqxl_main_loop.h |    1 +
>   3 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/src/qxl_driver.c b/src/qxl_driver.c
> index f847c12..a0d3da8 100644
> --- a/src/qxl_driver.c
> +++ b/src/qxl_driver.c
> @@ -637,10 +637,22 @@ spiceqxl_screen_init (ScrnInfoPtr pScrn, qxl_screen_t *qxl)
>       spice_server_init (qxl->spice_server, qxl->core);
>       qxl_add_spice_display_interface (qxl);
>       qxl_add_spice_playback_interface (qxl);
> +    }
> +    else
> +    {
> +        /* Crashes result from invalid xorg_timer pointers in
> +           our watch lists because Xorg clears all timers at server reset.
> +           We would require a fairly substantial revamp of how the
> +           spice server is started and operated to avoid this crash.  */
> +        ErrorF("WARNING: XSPICE requires -noreset; crashes are now likely.\n");
> +    }
> +
> +    if (! qxl->worker_running)
> +    {
> +        xspice_register_handlers();
>       qxl->worker->start (qxl->worker);
>       qxl->worker_running = TRUE;
>       }
> -    qxl->spice_server = qxl->spice_server;
>   }
>
>   #endif
> diff --git a/src/spiceqxl_main_loop.c b/src/spiceqxl_main_loop.c
> index e57fb91..a8a67de 100644
> --- a/src/spiceqxl_main_loop.c
> +++ b/src/spiceqxl_main_loop.c
> @@ -352,6 +352,10 @@ SpiceCoreInterface *basic_event_loop_init(void)
>       core.watch_update_mask = watch_update_mask;
>       core.watch_remove = watch_remove;
>       core.channel_event = channel_event;
> -    RegisterBlockAndWakeupHandlers(xspice_block_handler, xspice_wakeup_handler, 0);
>       return&core;
>   }
> +
> +void xspice_register_handlers(void)
> +{
> +    RegisterBlockAndWakeupHandlers(xspice_block_handler, xspice_wakeup_handler, 0);
> +}
> diff --git a/src/spiceqxl_main_loop.h b/src/spiceqxl_main_loop.h
> index 4cd5073..0e284ba 100644
> --- a/src/spiceqxl_main_loop.h
> +++ b/src/spiceqxl_main_loop.h
> @@ -28,5 +28,6 @@
>
>   SpiceCoreInterface *basic_event_loop_init(void);
>   void basic_event_loop_mainloop(void);
> +void xspice_register_handlers(void);
>
>   #endif // QXL_MAIN_LOOP_H


More information about the Spice-devel mailing list