diff options
author | lichun <lichun@ruijie.com.cn> | 2020-11-07 01:03:39 +0800 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-11-13 07:36:33 +0100 |
commit | 1cd8b9487025966123287e532636f231b46e8398 (patch) | |
tree | 963a2b32c10a87a62af5daa8948a8f3e4d5e48ac /ui | |
parent | a6e037390dd91276f4a631d41188c87e8a60bb3f (diff) |
console: avoid passing con=NULL to graphic_hw_update_done()
In graphic_hw_update(), first select an existing console,
a specific-console or active_console(if not specified),
then updating the console.
Signed-off-by: lichun <lichun@ruijie.com.cn>
Message-id: 1604682219-114389-1-git-send-email-lichun@ruijie.com.cn
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/console.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/console.c b/ui/console.c index e8e59707d3..e07d2c380d 100644 --- a/ui/console.c +++ b/ui/console.c @@ -270,10 +270,11 @@ void graphic_hw_update_done(QemuConsole *con) void graphic_hw_update(QemuConsole *con) { bool async = false; + con = con ? con : active_console; if (!con) { - con = active_console; + return; } - if (con && con->hw_ops->gfx_update) { + if (con->hw_ops->gfx_update) { con->hw_ops->gfx_update(con->hw); async = con->hw_ops->gfx_update_async; } |