From nobody Tue Feb 10 11:23:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635870414; cv=none; d=zohomail.com; s=zohoarc; b=MezTftilXo8iOMYfs509X7+sqDfiH2kUSnO42Zs6BjvXnmtCxstGPZ389tIb7QNecFQfsumMHjuQ87TIZkJaj8/V5WpIbsKP9TzAioL40i4pRlJrtPLcaFNnoRd6Ln8j/zglU5s1f4mw8BA2J5IcNm7xzIwpx6naUrXvA2PxaKM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635870414; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ut8NfEL2xC3MAi3C01zupa2EuTIP39swd/L1JHDpcAo=; b=Iu/Dmf7xYnkijOJPXoivJC+AxX595zKc/bAzPNWs2l5J6FqDLnfKZgb41ojTjQx7SnwjLCqenJWF0tjYsyWnh2gRdbg5ga/8s7DDNttm/YlfdhKPZM1uTkZof1yKyGrrgATWcdaXF+M4VGOwnPpFjID1dNwhBQUzfJJXC4KlCe8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1635870414325350.61861326536916; Tue, 2 Nov 2021 09:26:54 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-74-J0nKQX_RNgCsJAlghx5E6g-1; Tue, 02 Nov 2021 12:26:49 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AD5CDEC1A7; Tue, 2 Nov 2021 16:26:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D93D60C05; Tue, 2 Nov 2021 16:26:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 58ACF4EA3A; Tue, 2 Nov 2021 16:26:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2GQbP0005450 for ; Tue, 2 Nov 2021 12:26:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 05C26100751A; Tue, 2 Nov 2021 16:26:37 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7528310016F2; Tue, 2 Nov 2021 16:26:36 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id F23101801B2D; Tue, 2 Nov 2021 17:26:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635870413; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Ut8NfEL2xC3MAi3C01zupa2EuTIP39swd/L1JHDpcAo=; b=Pk6iQf+SQD9kkmwzo/f7+Lz1hMKXm0fw/zITHlPLA3iP46THwRiVkUR+QifmR+8qXN1xA8 vsD8wPcg87sdKqhcaWIJSKP4HlASvmSzl/zjlWveEpzuC+ynJjoxXeg7N6zAYRjubzthE0 1MLjy7mtfRlJgU7aH5G3e4/MUE1AHXU= X-MC-Unique: J0nKQX_RNgCsJAlghx5E6g-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 08/10] ui/console: remove chardev frontend connected test Date: Tue, 2 Nov 2021 17:26:17 +0100 Message-Id: <20211102162619.2760593-9-kraxel@redhat.com> In-Reply-To: <20211102162619.2760593-1-kraxel@redhat.com> References: <20211102162619.2760593-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Thomas Huth , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , libvir-list@redhat.com, =?UTF-8?q?Volker=20R=C3=BCmelin?= , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635870414945100001 From: Volker R=C3=BCmelin The test if the chardev frontend is connected in kbd_put_keysym_console() is redundant, because the call to qemu_chr_be_can_write() in kbd_send_chars() tests the connected condition again. Remove the redundant test whether the chardev frontend is connected. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Volker R=C3=BCmelin Message-Id: <20210916192239.18742-3-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- ui/console.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ui/console.c b/ui/console.c index dda1e6861d6a..29a3e3f0f51c 100644 --- a/ui/console.c +++ b/ui/console.c @@ -28,10 +28,11 @@ #include "qapi/error.h" #include "qapi/qapi-commands-ui.h" #include "qemu/fifo8.h" +#include "qemu/main-loop.h" #include "qemu/module.h" #include "qemu/option.h" #include "qemu/timer.h" -#include "chardev/char-fe.h" +#include "chardev/char.h" #include "trace.h" #include "exec/memory.h" #include "io/channel-file.h" @@ -1126,7 +1127,6 @@ static void kbd_send_chars(QemuConsole *s) void kbd_put_keysym_console(QemuConsole *s, int keysym) { uint8_t buf[16], *q; - CharBackend *be; int c; uint32_t num_free; =20 @@ -1170,12 +1170,9 @@ void kbd_put_keysym_console(QemuConsole *s, int keys= ym) if (s->echo) { vc_chr_write(s->chr, buf, q - buf); } - be =3D s->chr->be; - if (be && be->chr_read) { - num_free =3D fifo8_num_free(&s->out_fifo); - fifo8_push_all(&s->out_fifo, buf, MIN(num_free, q - buf)); - kbd_send_chars(s); - } + num_free =3D fifo8_num_free(&s->out_fifo); + fifo8_push_all(&s->out_fifo, buf, MIN(num_free, q - buf)); + kbd_send_chars(s); break; } } --=20 2.31.1