{"id":2229381,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2229381/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260428081303.990973-8-marcandre.lureau@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.1/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260428081303.990973-8-marcandre.lureau@redhat.com>","date":"2026-04-28T08:12:54","name":"[PULL,07/15] ui/console: remove qemu_console_is_visible()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"7a27c2488e7da41bc6981a69b2f69a52b8d1c203","submitter":{"id":66774,"url":"http://patchwork.ozlabs.org/api/1.1/people/66774/?format=json","name":"Marc-André Lureau","email":"marcandre.lureau@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260428081303.990973-8-marcandre.lureau@redhat.com/mbox/","series":[{"id":501785,"url":"http://patchwork.ozlabs.org/api/1.1/series/501785/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501785","date":"2026-04-28T08:12:48","name":"[PULL,01/15] ui: move FONT_WIDTH/HEIGHT to vgafont.h","version":1,"mbox":"http://patchwork.ozlabs.org/series/501785/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2229381/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2229381/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=ghF490mA;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4YBS1TsMz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 18:14:40 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wHdZr-00069h-SZ; Tue, 28 Apr 2026 04:13:55 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <marcandre.lureau@redhat.com>)\n id 1wHdZq-000679-E0\n for qemu-devel@nongnu.org; Tue, 28 Apr 2026 04:13:54 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <marcandre.lureau@redhat.com>)\n id 1wHdZo-00062A-P8\n for qemu-devel@nongnu.org; Tue, 28 Apr 2026 04:13:54 -0400","from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-480--TiiULULPFO0jEBIeQ57Ug-1; Tue,\n 28 Apr 2026 04:13:50 -0400","from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 83FD61800358; Tue, 28 Apr 2026 08:13:49 +0000 (UTC)","from localhost (unknown [10.44.24.6])\n by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 860E3196B8FB; Tue, 28 Apr 2026 08:13:48 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777364032;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=ZBBF7t1JGaQ+5NkzBMe2IvOwuHtbPA/oX7g06ftpQZY=;\n b=ghF490mASe8hENqzmZIlpPLx7jO29bjF7dljMscOtpM9CsRnGyhad8gNAHkQp/m7OkTpoR\n 3Luh62XoAvr3/F2pZ2g8wHtW7DzL1z2mjFxoX8juoA6GrEVgAdNkdUrg3ZVQwjpJbepX0x\n 5Q/uHXxttsqygpj+ZYHbvx1RrCJztzc=","X-MC-Unique":"-TiiULULPFO0jEBIeQ57Ug-1","X-Mimecast-MFC-AGG-ID":"-TiiULULPFO0jEBIeQ57Ug_1777364029","From":"marcandre.lureau@redhat.com","To":"qemu-devel@nongnu.org","Cc":"peter.maydell@linaro.org,\n =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>","Subject":"[PULL 07/15] ui/console: remove qemu_console_is_visible()","Date":"Tue, 28 Apr 2026 12:12:54 +0400","Message-ID":"<20260428081303.990973-8-marcandre.lureau@redhat.com>","In-Reply-To":"<20260428081303.990973-1-marcandre.lureau@redhat.com>","References":"<20260428081303.990973-1-marcandre.lureau@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.17","Received-SPF":"pass client-ip=170.10.133.124;\n envelope-from=marcandre.lureau@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"From: Marc-André Lureau <marcandre.lureau@redhat.com>\n\nDrop the bookkeeping, we can simply afford an empty \"foreach\".\n\nNotice that dpy_gfx_update_texture() is now called even when there are\nno listeners. This is more correct, as the texture is not fully\nrefreshed when a listener connects, so it may be outdated/garbaged.\n\nReviewed-by: Daniel P. Berrangé <berrange@redhat.com>\nSigned-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n---\n include/ui/console.h |  1 -\n ui/console-priv.h    |  1 -\n ui/console.c         | 29 -----------------------------\n 3 files changed, 31 deletions(-)","diff":"diff --git a/include/ui/console.h b/include/ui/console.h\nindex e2e5ff76ec1..f04844263b9 100644\n--- a/include/ui/console.h\n+++ b/include/ui/console.h\n@@ -399,7 +399,6 @@ QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head);\n QemuConsole *qemu_console_lookup_by_device_name(const char *device_id,\n                                                 uint32_t head, Error **errp);\n QEMUCursor *qemu_console_get_cursor(QemuConsole *con);\n-bool qemu_console_is_visible(QemuConsole *con);\n bool qemu_console_is_graphic(QemuConsole *con);\n bool qemu_console_is_fixedsize(QemuConsole *con);\n bool qemu_console_is_gl_blocked(QemuConsole *con);\ndiff --git a/ui/console-priv.h b/ui/console-priv.h\nindex 39798c3e9d7..2299898984d 100644\n--- a/ui/console-priv.h\n+++ b/ui/console-priv.h\n@@ -16,7 +16,6 @@ struct QemuConsole {\n     DisplayState *ds;\n     DisplaySurface *surface;\n     DisplayScanout scanout;\n-    int dcls;\n     DisplayGLCtx *gl;\n     int gl_block;\n     QEMUTimer *gl_unblock_timer;\ndiff --git a/ui/console.c b/ui/console.c\nindex 8f65308958a..abb6cba2826 100644\n--- a/ui/console.c\n+++ b/ui/console.c\n@@ -648,9 +648,6 @@ void register_displaychangelistener(DisplayChangeListener *dcl)\n     dcl->ds = get_alloc_displaystate();\n     QLIST_INSERT_HEAD(&dcl->ds->listeners, dcl, next);\n     gui_setup_refresh(dcl->ds);\n-    if (dcl->con) {\n-        dcl->con->dcls++;\n-    }\n     displaychangelistener_display_console(dcl, &error_fatal);\n     if (QEMU_IS_GRAPHIC_CONSOLE(dcl->con)) {\n         dcl_set_graphic_cursor(dcl, QEMU_GRAPHIC_CONSOLE(dcl->con));\n@@ -678,9 +675,6 @@ void unregister_displaychangelistener(DisplayChangeListener *dcl)\n     if (!ds) {\n         return;\n     }\n-    if (dcl->con) {\n-        dcl->con->dcls--;\n-    }\n     QLIST_REMOVE(dcl, next);\n     dcl->ds = NULL;\n     gui_setup_refresh(ds);\n@@ -745,9 +739,6 @@ void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h)\n     w = MIN(w, width - x);\n     h = MIN(h, height - y);\n \n-    if (!qemu_console_is_visible(con)) {\n-        return;\n-    }\n     dpy_gfx_update_texture(con, con->surface, x, y, w, h);\n     QLIST_FOREACH(dcl, &s->listeners, next) {\n         if (con != dcl->con) {\n@@ -846,9 +837,6 @@ void dpy_text_cursor(QemuConsole *con, int x, int y)\n     DisplayState *s = con->ds;\n     DisplayChangeListener *dcl;\n \n-    if (!qemu_console_is_visible(con)) {\n-        return;\n-    }\n     QLIST_FOREACH(dcl, &s->listeners, next) {\n         if (con != dcl->con) {\n             continue;\n@@ -864,9 +852,6 @@ void dpy_text_update(QemuConsole *con, int x, int y, int w, int h)\n     DisplayState *s = con->ds;\n     DisplayChangeListener *dcl;\n \n-    if (!qemu_console_is_visible(con)) {\n-        return;\n-    }\n     QLIST_FOREACH(dcl, &s->listeners, next) {\n         if (con != dcl->con) {\n             continue;\n@@ -882,9 +867,6 @@ void dpy_text_resize(QemuConsole *con, int w, int h)\n     DisplayState *s = con->ds;\n     DisplayChangeListener *dcl;\n \n-    if (!qemu_console_is_visible(con)) {\n-        return;\n-    }\n     QLIST_FOREACH(dcl, &s->listeners, next) {\n         if (con != dcl->con) {\n             continue;\n@@ -904,9 +886,6 @@ void dpy_mouse_set(QemuConsole *c, int x, int y, bool on)\n     con->cursor_x = x;\n     con->cursor_y = y;\n     con->cursor_on = on;\n-    if (!qemu_console_is_visible(c)) {\n-        return;\n-    }\n     QLIST_FOREACH(dcl, &s->listeners, next) {\n         if (c != dcl->con) {\n             continue;\n@@ -925,9 +904,6 @@ void dpy_cursor_define(QemuConsole *c, QEMUCursor *cursor)\n \n     cursor_unref(con->cursor);\n     con->cursor = cursor_ref(cursor);\n-    if (!qemu_console_is_visible(c)) {\n-        return;\n-    }\n     QLIST_FOREACH(dcl, &s->listeners, next) {\n         if (c != dcl->con) {\n             continue;\n@@ -1285,11 +1261,6 @@ QEMUCursor *qemu_console_get_cursor(QemuConsole *con)\n     return QEMU_IS_GRAPHIC_CONSOLE(con) ? QEMU_GRAPHIC_CONSOLE(con)->cursor : NULL;\n }\n \n-bool qemu_console_is_visible(QemuConsole *con)\n-{\n-    return con->dcls > 0;\n-}\n-\n bool qemu_console_is_graphic(QemuConsole *con)\n {\n     return con && QEMU_IS_GRAPHIC_CONSOLE(con);\n","prefixes":["PULL","07/15"]}