All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P . Berrangé" <berrange@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [PULL 2/8] console: allow con==NULL in dpy_{get, set}_ui_info and dpy_ui_info_supported
Date: Fri, 11 Dec 2020 10:12:44 +0100	[thread overview]
Message-ID: <20201211091250.1415-3-kraxel@redhat.com> (raw)
In-Reply-To: <20201211091250.1415-1-kraxel@redhat.com>

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
---
 ui/console.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ui/console.c b/ui/console.c
index f995639e45f6..30e70be555db 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;
-- 
2.27.0



  parent reply	other threads:[~2020-12-11  9:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11  9:12 [PULL 0/8] Ui 20201211 patches Gerd Hoffmann
2020-12-11  9:12 ` [PULL 1/8] console: drop qemu_console_get_ui_info Gerd Hoffmann
2020-12-11  9:12 ` Gerd Hoffmann [this message]
2020-12-11  9:12 ` [PULL 3/8] vnc: use enum for features Gerd Hoffmann
2020-12-11  9:12 ` [PULL 4/8] vnc: drop unused copyrect feature Gerd Hoffmann
2020-12-11  9:12 ` [PULL 5/8] vnc: add pseudo encodings Gerd Hoffmann
2020-12-11  9:12 ` [PULL 6/8] vnc: add alpha cursor support Gerd Hoffmann
2020-12-11  9:12 ` [PULL 7/8] ui/vnc: Add missing lock for send_color_map Gerd Hoffmann
2020-12-11  9:12 ` [PULL 8/8] sdl2: Add extra mouse buttons Gerd Hoffmann
2020-12-11 19:30 ` [PULL 0/8] Ui 20201211 patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201211091250.1415-3-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.