On Thu, Dec 3, 2020 at 3:08 PM Gerd Hoffmann <kra...@redhat.com> wrote:

> Verify the hw_ops->ui_info function pointer is non-zero before
> calling it.  Can be triggered by qxl which changes hw_ops when
> switching between qxl-native and vga-compat modes.
>
> Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
> ---
>  ui/console.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/ui/console.c b/ui/console.c
> index 16b326854080..8930808d0b6d 100644
> --- a/ui/console.c
> +++ b/ui/console.c
> @@ -1539,7 +1539,9 @@ static void dpy_set_ui_info_timer(void *opaque)
>  {
>      QemuConsole *con = opaque;
>
> -    con->hw_ops->ui_info(con->hw, con->head, &con->ui_info);
> +    if (con->hw_ops->ui_info) {
> +        con->hw_ops->ui_info(con->hw, con->head, &con->ui_info);
> +    }
>

That would ignore the last UI info change, right? Is there a place where it
is actually taken care off later? If yes, perhaps worth a comment. If not,
should it reschedule the timer or should there be a warning on the console?

 }
>
>  bool dpy_ui_info_supported(QemuConsole *con)
> --
> 2.27.0
>
>
>

-- 
Marc-André Lureau

Reply via email to