diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-12-08 12:57:30 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-12-11 08:06:39 +0100 |
commit | 5c4b107f88ad2679817b73445fa706c62db4d8e0 (patch) | |
tree | 60271e02fa8e6bb0b895b6986acd4e0ffefb3d73 /ui | |
parent | c7b22c0a7c48a048703802eb6534930f18b9e44c (diff) |
console: allow con==NULL in dpy_{get, set}_ui_info and dpy_ui_info_supported
Use active_console in that case like we do in many other places.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20201208115737.18581-3-kraxel@redhat.com
Diffstat (limited to 'ui')
-rw-r--r-- | ui/console.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/console.c b/ui/console.c index f995639e45..30e70be555 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1544,19 +1544,27 @@ static void dpy_set_ui_info_timer(void *opaque) bool dpy_ui_info_supported(QemuConsole *con) { + if (con == NULL) { + con = active_console; + } + return con->hw_ops->ui_info != NULL; } const QemuUIInfo *dpy_get_ui_info(const QemuConsole *con) { - assert(con != NULL); + if (con == NULL) { + con = active_console; + } return &con->ui_info; } int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info) { - assert(con != NULL); + if (con == NULL) { + con = active_console; + } if (!dpy_ui_info_supported(con)) { return -1; |