qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/9] console: add check for ui_info pointer


From: Marc-André Lureau
Subject: Re: [PATCH 2/9] console: add check for ui_info pointer
Date: Fri, 4 Dec 2020 15:32:06 +0400



On Thu, Dec 3, 2020 at 3:08 PM Gerd Hoffmann <kraxel@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 <kraxel@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

[Prev in Thread] Current Thread [Next in Thread]