From 5c4b107f88ad2679817b73445fa706c62db4d8e0 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 8 Dec 2020 12:57:30 +0100 Subject: console: allow con==NULL in dpy_{get, set}_ui_info and dpy_ui_info_supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use active_console in that case like we do in many other places. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrangé Message-id: 20201208115737.18581-3-kraxel@redhat.com --- ui/console.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ui') 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; -- cgit v1.2.3