From patchwork Thu Jul 6 12:08:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9828105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B1A54602BD for ; Thu, 6 Jul 2017 12:14:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E91C283A5 for ; Thu, 6 Jul 2017 12:14:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 907DF28631; Thu, 6 Jul 2017 12:14:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 66B06283A5 for ; Thu, 6 Jul 2017 12:14:57 +0000 (UTC) Received: from localhost ([::1]:51168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT5gO-0000IJ-HF for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Jul 2017 08:14:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT5bh-0005U5-Lr for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:10:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dT5bd-0004jc-JV for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:10:05 -0400 Received: from mail-db5eur01on0125.outbound.protection.outlook.com ([104.47.2.125]:45242 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dT5bd-0004j4-4b for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:10:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=6Cb+8+O7xiBQV50ML8g3t9AEsc3x+nWxn/aYmDseODY=; b=eNmtiQibN7wNSEsUaB8p7wPWeV4gi0/d7DSM+ZBV2RlGl4WbzS7dWzNHAcGUCqbQw3hnoffLvp6ABdh2ZlaVCPrK1LWj9Cpo1kylOeXBsY1jzpsGuAlo53liPFic2qLbtd8ZKgCiIei7b5ExFgoNJtifwN1c3f5TnvPC7LlKnfM= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by AM5PR0801MB1985.eurprd08.prod.outlook.com (2603:10a6:203:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.13; Thu, 6 Jul 2017 12:09:53 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Thu, 6 Jul 2017 15:08:52 +0300 Message-ID: <1499342940-56739-6-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499342940-56739-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1499342940-56739-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HK2PR02CA0118.apcprd02.prod.outlook.com (2a01:111:e400:79aa::44) To AM5PR0801MB1985.eurprd08.prod.outlook.com (2603:10a6:203:4b::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef11ee24-1de4-4c24-fe9e-08d4c467ebd2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:AM5PR0801MB1985; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 3:bnBvGi0mK7HOvSZ+QWyPQrApTXk7UxUeURUYFz9b8k/9po/CD8S5buJfTSP+J31eybtMA8aFtsNmJxkXpjmlKqxeTDmTfMLRKQmf2I/nlZyczyO+AP1voo88t/BR5hkymPseRiei2SChgaAlcJjU4lDCPScKMlkGV31PesUlv0fYJzpb+7F802N8/KsRfsPYuDwPKSOt3AnAFUKwfnGTfZTD4B6u5/kVm/iGVh22/OQsPmdP00H/3ROtXXbFPHBPy3c90SvgSy85ukWFLRWLBhIQqGluO/H72RZaVDxwjfKnORE2x5nYvwdsOYCvY5otq/f7QZq7jOPDTPqL2qEQR5RsFJBV5mfU8PR48NhtfQ7aCvUROL55dU3ax9bcImzdOujHO038ZueXrS6yAGZEb0iseoqd7K6O//D0ntaJZa2ZKXeDLUlGMeO8e5BCIkKgYeOOAbiui3jkbE0qIbLaRCeUWngasDazAaHjIh4kuvzjGldiiCToyLbDplWxYCWNTS7s56oy5VJEY2zHEAv6Zwf56N05dlP3Oqk0okMNk1h0Kn3FcHu2017g1XGq2h59vY4UrUr7vzMijvB0+bdo0yYxKKSKlzrNvpB/MKunvpe0cUrK9YnuK0leVv1aAw+J1RNeT67fhy52bZGUMqKyPg8Qx/t+qR9tpMvSCx9z2yBeVNMmRhsJBoLg3yPv0CE9MXaQO7psa5OYmcLtp41pZYRuPOTHQot7i5Om/swNJMqItVC1FrThpfljiZcx0W1Q X-MS-TrafficTypeDiagnostic: AM5PR0801MB1985: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 25:OTo1yNnICDXxwyCN2uYL9Giy/vkQuIdmfWiOU5l8VtNLFwAA1fT/xGbG6syDis8OZHkbS3zal7ZRbk8WNAk/0We2zxMBSxAGdSUi6KPOsKiH/1znzIIgkozkBYmaPdHv6CIHBli/TaimADrYfUU40MA7biJwM6G9VYTV9JoKrZj3QtiynL3KyM7knqso9y0zPk11biSXhIonyfZzBlEVjK6zu9BhYlkqGUqxeWkpBDldHUYgRPLUy0AOxTd+wY1Y4j9UaOznmLAH+X5UkediaainP4kFAR+n764HrX9E5GOOghZ9UZ/KneC8lSXOJO68LIGzaZUrjWVFpJVWMt7YoNLpa5dRM88dYVeAbEPMDJRUwGIq3tteF/06EdFqmUogF0LfN3lQUxcK+JjqBuUqcTgb3+Th9SuFP7It6lACwqmSidsKrCsXrMXvQXYmBGElu4Erko5voH/XS7nICzAv+EjRfYVsJJu99n91be9zPIrBnGXQ7Eg7tzIglcB905A31YIQfyPzkr5Y5rxA+Jxa4dVbPYqJO18uCPO9hIFrLbDPJ+8NLkVtfw6zl4kZFCHfbxzJ/d7jCsmT4Tjy+G7xcij4TzzioV6cZxvp0sCNUN/k8i2Jx0aiIx5onPXbDpTk0jujZjAXDB9mVxT2852PKljliEsfCYMq6q+EaLAiB5vreXqRGkJj5/DkIdxXbOxBXES8OAFpXfZ4y91I04CFGX12m+oXig3eD8tzzaKhN+LNTtyhq9W6Ekl8ssYuMMPUmpNMmNDPLqnMsW+b9xBq3s81XD3DeC/CzUzpuDaLspIG/vtjJHGmG8JsNq/jzbbRb2+3w/SFUNatkVvwFJb5o+jfWpsAfdLLYZeUShA9W4JykcibOrBHTZM/pk6fWXgKOu+OsHOa7tABksLBp1KxK0hZO44HI0a42tfCfsJYJFY= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 31:9dccDpKrNigixzlNOEayS74h3QIUMMpdbmDCQMX2a1v+2CSKt0vD0PfWwwwXh1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Aqjs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863)(236129657087228)(50300203121483)(247924648384137); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0801MB1985; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0801MB1985; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1985; 4:1i4yLQnAfsh7phzCneO8NNAhBLPNJO9p6Hw+Sa0o?= =?us-ascii?Q?dCeWbunN/Xl+GrCZSuEsNnfPkH/dFmsgeceyirIYcOpyVMlOeZuXvOVW4iKV?= =?us-ascii?Q?OVL+p5U1U6j+8r3YIIYNX235rI8xBBOS98JlDVXRxZhAHV2RDOF2zV58WMs5?= =?us-ascii?Q?QVnVMCf5ojJzJNW1v0gdQoPhIdx7TPdvaxoiTZIA68xrT5Txp6OpewEwRB/N?= =?us-ascii?Q?B+dBsjchuQ6yuE0Fx9uirmRt8nIVpjIKuPvPyoeg5eSu/2nQ9Qp2uskNccAn?= =?us-ascii?Q?grHKAdTksN1n/HOLU6uRoKIp8phdwstXi2KWJ/W9dKv6fmbS96fDo10Y1w5b?= =?us-ascii?Q?9maiQWWLrjqpJmh+yBjt3jWpOXOwfNWNZJe1kDt/imPv06arjYTvySXAFUl5?= =?us-ascii?Q?cIuwI7Tc7OKcmY4P8bWSrSl5KBTBNU155hXXks8LoedBGvI2BgS3STAEXClg?= =?us-ascii?Q?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?= X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39400400002)(39840400002)(39410400002)(2870700001)(81166006)(8676002)(36756003)(2351001)(23676002)(50226002)(575784001)(25786009)(86362001)(50466002)(305945005)(478600001)(5660300001)(189998001)(6116002)(3846002)(7736002)(4326008)(107886003)(38730400002)(5890100001)(66066001)(110136004)(47776003)(2950100002)(53936002)(76176999)(6506006)(6512007)(2361001)(6916009)(33646002)(50986999)(42186005)(6486002)(2906002)(53416004)(21314002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0801MB1985; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1985; 23:Jw6A10K8DuRGo89Ks+slW0EBGi8tvn28PjcMG13?= =?us-ascii?Q?w3fwx4zJKpBHfaVA44NUHDl6lZ31ZSmoBfSFGHV+tlt20taam987ZXZAoAMa?= =?us-ascii?Q?VUXsxX6fYYSbaZNyf6tgsuZfKAjDJSsl3Gc1fn9SjyJInWZ5AxxAk83cKG+u?= =?us-ascii?Q?K0JK+rj2qDvjeq1UH55zUJqRSeS55Azas92RqlQmmbVT9AfjSkixU1PD01b9?= =?us-ascii?Q?nIOzlH6Fu1u0MxboAdxYan/F9nTziEZC9lASlUwrIT3PdTEq+AEUFrS9MQ36?= =?us-ascii?Q?R1P27RWEuv/J67H5Y2GFj47MMNyXc09NrvmYkIpTrAQZhGVPVL+h5edEWxsh?= =?us-ascii?Q?FEddf3AOK0NjKyE1NmBQI9cwM3o3Bh4lWvVDhOUIvIC6IpeMrWEJqdFXWpQ4?= =?us-ascii?Q?PJLnYn1eRpTtyFCFxS2zDaoPkz+H6t58sGzam3Bel7E/yMVnB+0tFk8m0+ua?= =?us-ascii?Q?WEqnXxeKXVL9gpZBKUxTgzbgaeX7kBP6eC8M+TAxzwTgcasDyQdbAxZCaD/T?= =?us-ascii?Q?Jl/eVx3K0E1phIocMPm5zKYcB5cVQ/HzBSXdqKujsxIJzy+dwliOSE4Ktvsm?= =?us-ascii?Q?DBxi0hgIazbmhojYuPavrYiAPppcn5/s2wshk1xRo3udjO1ySSVBVt+f73es?= =?us-ascii?Q?tgHt8n1fsNL0gODaV39Fcf0Ojng05CTUSw5gEUNxLStYSd3awWHPRI6vfmVW?= =?us-ascii?Q?67f3AdtSmoqEa6CX3HhqtEgIZgzz56xHVMjFK1dWnPIzgFwxWDjBZWOgvPA7?= =?us-ascii?Q?vEN3kNzwPeED+BaK1hZrUuFmAXz95IMSCk7FA+Flgox/nojwxG5dF4+tWUwf?= =?us-ascii?Q?6blz5IWMU3d4B6H4m6McJuVdLZfOecLzmFcmVM2NTdTeL8eG53Twjx9/Fx1H?= =?us-ascii?Q?700YxXXu4CQA/epUiQuwqk+XN6mBiB+PMI9bWqcMCCTfyaHeAVnR6j4U/cLr?= =?us-ascii?Q?cakYrlUmRMvFkmzMRDDlLEdJ7miHFDPwHiU8Jb6Yt4d68DvRTV986W+c2c4d?= =?us-ascii?Q?HSC/bJgZt1kmd8cLg331cqQzpEwIQOzqWbRytAWZ0L3oTcoyzn+HepCTdIn1?= =?us-ascii?Q?Ur8nz6oUr2XKaAgmNs2Fv1LaC97XZT/Z0w7ySe8rt+xks0tPoHiO+GuM2L3t?= =?us-ascii?Q?US5SC0i2JbYM=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1985; 6:zZsruW1nRsj/nS5q+wjYv+MB+K+iuzymaYHryeY/?= =?us-ascii?Q?8HY0CCsWJUtM0OyXME3okSm1MSO9Z2VN3KZG+YUI9TECtNLtUV14WH35dl10?= =?us-ascii?Q?hNw7gg6coYp9bo2N+fpLNbpc6G5LdjecjJsZjS4V4yvfLI13b2l6vodCAmOZ?= =?us-ascii?Q?24vVV7NNmD9i4X532imtyT58exEm6z0cpLWXZdOYLWGD9qWBemdBiczD2RlB?= =?us-ascii?Q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zW8uXlT2Vcc+vSQTlCCnLGlA05GGutvyB+Lp4UOAcHSyUAOOqPDmH5saVGYhDNCOBGWuwnp69tColRZdPsu0ltrs47TE7H3lmhH32ZP1dJn2/6QU+SyYi6MxVpqOVCXeB0SPnxu0TaN60EUUJsdyvS1Qh8tcaRJmL5QiKDoRHvUDVwv7le/ii55b0rugqXo/qSqruLL1gBEf7n7mYvrOhywsEQEYX25PKod0btpyjDmuqbm0FCfBgoQS/3NIC3nuALzpQn9aLF1nRojzIlL1r2Dsoj1kjczuY2VFU4WPwSaBOZPI0av34jJYZ3ufliaw5nvWGK+PDwoAaAhQQiPwj7KCHlY3ZKCe6nPWCZBFJ/lS7QdT+kRrQBE= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 20:4mDAI6/xG2MjTy2dHIls5+bU1QLONzOxNaUJ4C2BNzC/Wuihawczn8Ejb/amDNHrsJAwdgsJ0EoGZ8ChMCpmDB5wL99mExQX8TcWloozv3N/raBIt8zzXouOjRnumYt2vOKAAxgCNY31UXED2/gZ/dyT7Q0vShkh7dDU6BIkwiU= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2017 12:09:53.4637 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1985 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.125 Subject: [Qemu-devel] [PATCH v6 05/13] char: avoid chardevice direct access X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anton Nefedov , den@virtuozzo.com, amit@kernel.org, mst@redhat.com, marcandre.lureau@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP frontends should avoid accessing CharDriver struct where possible Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Marc-André Lureau --- include/chardev/char-fe.h | 7 +++++++ chardev/char-fe.c | 5 +++++ hw/arm/strongarm.c | 2 +- hw/char/cadence_uart.c | 2 +- hw/char/debugcon.c | 2 +- hw/char/escc.c | 6 +++--- hw/char/exynos4210_uart.c | 2 +- hw/char/grlib_apbuart.c | 2 +- hw/char/ipoctal232.c | 2 +- hw/char/parallel.c | 2 +- hw/char/sclpconsole-lm.c | 2 +- hw/char/sclpconsole.c | 2 +- hw/char/serial.c | 2 +- hw/char/sh_serial.c | 2 +- hw/char/spapr_vty.c | 2 +- hw/char/terminal3270.c | 2 +- hw/char/virtio-console.c | 5 ++--- hw/char/xen_console.c | 2 +- hw/ipmi/ipmi_bmc_extern.c | 2 +- hw/misc/ivshmem.c | 4 ++-- hw/usb/ccid-card-passthru.c | 4 ++-- hw/usb/dev-serial.c | 5 ++--- hw/usb/redirect.c | 5 ++--- net/filter-mirror.c | 2 +- 24 files changed, 41 insertions(+), 32 deletions(-) diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h index 588abed..71cd069 100644 --- a/include/chardev/char-fe.h +++ b/include/chardev/char-fe.h @@ -60,6 +60,13 @@ Chardev *qemu_chr_fe_get_driver(CharBackend *be); bool qemu_chr_fe_backend_connected(CharBackend *be); /** + * @qemu_chr_fe_backend_open: + * + * Returns true if chardevice associated with @be is open. + */ +bool qemu_chr_fe_backend_open(CharBackend *be); + +/** * @qemu_chr_fe_set_handlers: * @b: a CharBackend * @fd_can_read: callback to get the amount of data the frontend may diff --git a/chardev/char-fe.c b/chardev/char-fe.c index de5ba3c..f3af6ae 100644 --- a/chardev/char-fe.c +++ b/chardev/char-fe.c @@ -189,6 +189,11 @@ bool qemu_chr_fe_backend_connected(CharBackend *be) return !!be->chr; } +bool qemu_chr_fe_backend_open(CharBackend *be) +{ + return be->chr && be->chr->be_open; +} + bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error **errp) { int tag = 0; diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index 1fa082c..6a45dcc 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -1106,7 +1106,7 @@ static void strongarm_uart_tx(void *opaque) if (s->utcr3 & UTCR3_LBM) /* loopback */ { strongarm_uart_receive(s, &s->tx_fifo[s->tx_start], 1); - } else if (qemu_chr_fe_get_driver(&s->chr)) { + } else if (qemu_chr_fe_backend_connected(&s->chr)) { /* XXX this blocks entire thread. Rewrite to use * qemu_chr_fe_write and background I/O callbacks */ qemu_chr_fe_write_all(&s->chr, &s->tx_fifo[s->tx_start], 1); diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c index 3a9335c..6143494 100644 --- a/hw/char/cadence_uart.c +++ b/hw/char/cadence_uart.c @@ -279,7 +279,7 @@ static gboolean cadence_uart_xmit(GIOChannel *chan, GIOCondition cond, int ret; /* instant drain the fifo when there's no back-end */ - if (!qemu_chr_fe_get_driver(&s->chr)) { + if (!qemu_chr_fe_backend_connected(&s->chr)) { s->tx_count = 0; return FALSE; } diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c index 9b56fb8..95ccec6 100644 --- a/hw/char/debugcon.c +++ b/hw/char/debugcon.c @@ -87,7 +87,7 @@ static const MemoryRegionOps debugcon_ops = { static void debugcon_realize_core(DebugconState *s, Error **errp) { - if (!qemu_chr_fe_get_driver(&s->chr)) { + if (!qemu_chr_fe_backend_connected(&s->chr)) { error_setg(errp, "Can't create debugcon device, empty char device"); return; } diff --git a/hw/char/escc.c b/hw/char/escc.c index 3546df3..89ae9eb 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -417,7 +417,7 @@ static void escc_update_parameters(ChannelState *s) int speed, parity, data_bits, stop_bits; QEMUSerialSetParams ssp; - if (!qemu_chr_fe_get_driver(&s->chr) || s->type != ser) + if (!qemu_chr_fe_backend_connected(&s->chr) || s->type != ser) return; if (s->wregs[W_TXCTRL1] & TXCTRL1_PAREN) { @@ -557,7 +557,7 @@ static void escc_mem_write(void *opaque, hwaddr addr, trace_escc_mem_writeb_data(CHN_C(s), val); s->tx = val; if (s->wregs[W_TXCTRL2] & TXCTRL2_TXEN) { // tx enabled - if (qemu_chr_fe_get_driver(&s->chr)) { + if (qemu_chr_fe_backend_connected(&s->chr)) { /* XXX this blocks entire thread. Rewrite to use * qemu_chr_fe_write and background I/O callbacks */ qemu_chr_fe_write_all(&s->chr, &s->tx, 1); @@ -1013,7 +1013,7 @@ static void escc_realize(DeviceState *dev, Error **errp) ESCC_SIZE << s->it_shift); for (i = 0; i < 2; i++) { - if (qemu_chr_fe_get_driver(&s->chn[i].chr)) { + if (qemu_chr_fe_backend_connected(&s->chn[i].chr)) { s->chn[i].clock = s->frequency / 2; qemu_chr_fe_set_handlers(&s->chn[i].chr, serial_can_receive, serial_receive1, serial_event, NULL, diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c index a84d2c3..3957e78 100644 --- a/hw/char/exynos4210_uart.c +++ b/hw/char/exynos4210_uart.c @@ -380,7 +380,7 @@ static void exynos4210_uart_write(void *opaque, hwaddr offset, break; case UTXH: - if (qemu_chr_fe_get_driver(&s->chr)) { + if (qemu_chr_fe_backend_connected(&s->chr)) { s->reg[I_(UTRSTAT)] &= ~(UTRSTAT_TRANSMITTER_EMPTY | UTRSTAT_Tx_BUFFER_EMPTY); ch = (uint8_t)val; diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c index 12d0c99..bac11be 100644 --- a/hw/char/grlib_apbuart.c +++ b/hw/char/grlib_apbuart.c @@ -201,7 +201,7 @@ static void grlib_apbuart_write(void *opaque, hwaddr addr, case DATA_OFFSET: case DATA_OFFSET + 3: /* When only one byte write */ /* Transmit when character device available and transmitter enabled */ - if (qemu_chr_fe_get_driver(&uart->chr) && + if (qemu_chr_fe_backend_connected(&uart->chr) && (uart->control & UART_TRANSMIT_ENABLE)) { c = value & 0xFF; /* XXX this blocks entire thread. Rewrite to use diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c index cc8c8dc..5e09caf 100644 --- a/hw/char/ipoctal232.c +++ b/hw/char/ipoctal232.c @@ -542,7 +542,7 @@ static void ipoctal_realize(DeviceState *dev, Error **errp) ch->ipoctal = s; /* Redirect IP-Octal channels to host character devices */ - if (qemu_chr_fe_get_driver(&ch->dev)) { + if (qemu_chr_fe_backend_connected(&ch->dev)) { qemu_chr_fe_set_handlers(&ch->dev, hostdev_can_receive, hostdev_receive, hostdev_event, NULL, ch, NULL, true); diff --git a/hw/char/parallel.c b/hw/char/parallel.c index 75a1a2f..055789f 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -513,7 +513,7 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp) int base; uint8_t dummy; - if (!qemu_chr_fe_get_driver(&s->chr)) { + if (!qemu_chr_fe_backend_connected(&s->chr)) { error_setg(errp, "Can't create parallel device, empty char device"); return; } diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index 741c641..c500bda 100644 --- a/hw/char/sclpconsole-lm.c +++ b/hw/char/sclpconsole-lm.c @@ -195,7 +195,7 @@ static int write_console_data(SCLPEvent *event, const uint8_t *buf, int len) { SCLPConsoleLM *scon = SCLPLM_CONSOLE(event); - if (!qemu_chr_fe_get_driver(&scon->chr)) { + if (!qemu_chr_fe_backend_connected(&scon->chr)) { /* If there's no backend, we can just say we consumed all data. */ return len; } diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c index a92baa8..d0265df 100644 --- a/hw/char/sclpconsole.c +++ b/hw/char/sclpconsole.c @@ -163,7 +163,7 @@ static ssize_t write_console_data(SCLPEvent *event, const uint8_t *buf, { SCLPConsole *scon = SCLP_CONSOLE(event); - if (!qemu_chr_fe_get_driver(&scon->chr)) { + if (!qemu_chr_fe_backend_connected(&scon->chr)) { /* If there's no backend, we can just say we consumed all data. */ return len; } diff --git a/hw/char/serial.c b/hw/char/serial.c index ab14ca4..b4fb8f3 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -886,7 +886,7 @@ static void serial_reset(void *opaque) void serial_realize_core(SerialState *s, Error **errp) { - if (!qemu_chr_fe_get_driver(&s->chr)) { + if (!qemu_chr_fe_backend_connected(&s->chr)) { error_setg(errp, "Can't create serial device, empty char device"); return; } diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c index ad043bd..835b537 100644 --- a/hw/char/sh_serial.c +++ b/hw/char/sh_serial.c @@ -110,7 +110,7 @@ static void sh_serial_write(void *opaque, hwaddr offs, } return; case 0x0c: /* FTDR / TDR */ - if (qemu_chr_fe_get_driver(&s->chr)) { + if (qemu_chr_fe_backend_connected(&s->chr)) { ch = val; /* XXX this blocks entire thread. Rewrite to use * qemu_chr_fe_write and background I/O callbacks */ diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c index ddd1b00..0fa416c 100644 --- a/hw/char/spapr_vty.c +++ b/hw/char/spapr_vty.c @@ -78,7 +78,7 @@ static void spapr_vty_realize(VIOsPAPRDevice *sdev, Error **errp) { VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(sdev); - if (!qemu_chr_fe_get_driver(&dev->chardev)) { + if (!qemu_chr_fe_backend_connected(&dev->chardev)) { error_setg(errp, "chardev property not set"); return; } diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c index 5adf95b..28f5991 100644 --- a/hw/char/terminal3270.c +++ b/hw/char/terminal3270.c @@ -239,7 +239,7 @@ static int write_payload_3270(EmulatedCcw3270Device *dev, uint8_t cmd, return 0; } } - if (!qemu_chr_fe_get_driver(&t->chr)) { + if (!qemu_chr_fe_backend_connected(&t->chr)) { /* We just say we consumed all data if there's no backend. */ return count; } diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c index afb4949..4d3967c 100644 --- a/hw/char/virtio-console.c +++ b/hw/char/virtio-console.c @@ -49,7 +49,7 @@ static ssize_t flush_buf(VirtIOSerialPort *port, VirtConsole *vcon = VIRTIO_CONSOLE(port); ssize_t ret; - if (!qemu_chr_fe_get_driver(&vcon->chr)) { + if (!qemu_chr_fe_backend_connected(&vcon->chr)) { /* If there's no backend, we can just say we consumed all data. */ return len; } @@ -168,7 +168,6 @@ static void virtconsole_realize(DeviceState *dev, Error **errp) VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(dev); VirtConsole *vcon = VIRTIO_CONSOLE(dev); VirtIOSerialPortClass *k = VIRTIO_SERIAL_PORT_GET_CLASS(dev); - Chardev *chr = qemu_chr_fe_get_driver(&vcon->chr); if (port->id == 0 && !k->is_console) { error_setg(errp, "Port number 0 on virtio-serial devices reserved " @@ -176,7 +175,7 @@ static void virtconsole_realize(DeviceState *dev, Error **errp) return; } - if (chr) { + if (qemu_chr_fe_backend_connected(&vcon->chr)) { /* * For consoles we don't block guest data transfer just * because nothing is connected - we'll just let it go diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index c4e8c72..3643dfe 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -150,7 +150,7 @@ static void xencons_send(struct XenConsole *con) ssize_t len, size; size = con->buffer.size - con->buffer.consumed; - if (qemu_chr_fe_get_driver(&con->chr)) { + if (qemu_chr_fe_backend_connected(&con->chr)) { len = qemu_chr_fe_write(&con->chr, con->buffer.data + con->buffer.consumed, size); diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index 182de58..abab3bb 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -447,7 +447,7 @@ static void ipmi_bmc_extern_realize(DeviceState *dev, Error **errp) { IPMIBmcExtern *ibe = IPMI_BMC_EXTERN(dev); - if (!qemu_chr_fe_get_driver(&ibe->chr)) { + if (!qemu_chr_fe_backend_connected(&ibe->chr)) { error_setg(errp, "IPMI external bmc requires chardev attribute"); return; } diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index a857e50..7f678d0 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -1128,7 +1128,7 @@ static void ivshmem_doorbell_realize(PCIDevice *dev, Error **errp) { IVShmemState *s = IVSHMEM_COMMON(dev); - if (!qemu_chr_fe_get_driver(&s->server_chr)) { + if (!qemu_chr_fe_backend_connected(&s->server_chr)) { error_setg(errp, "You must specify a 'chardev'"); return; } @@ -1257,7 +1257,7 @@ static void ivshmem_realize(PCIDevice *dev, Error **errp) " or ivshmem-doorbell instead"); } - if (!!qemu_chr_fe_get_driver(&s->server_chr) + !!s->shmobj != 1) { + if (qemu_chr_fe_backend_connected(&s->server_chr) + !!s->shmobj != 1) { error_setg(errp, "You must specify either 'shm' or 'chardev'"); return; } diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index e9f58c9..45d96b0 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -322,7 +322,7 @@ static void passthru_apdu_from_guest( { PassthruState *card = PASSTHRU_CCID_CARD(base); - if (!qemu_chr_fe_get_driver(&card->cs)) { + if (!qemu_chr_fe_backend_connected(&card->cs)) { printf("ccid-passthru: no chardev, discarding apdu length %d\n", len); return; } @@ -343,7 +343,7 @@ static int passthru_initfn(CCIDCardState *base) card->vscard_in_pos = 0; card->vscard_in_hdr = 0; - if (qemu_chr_fe_get_driver(&card->cs)) { + if (qemu_chr_fe_backend_connected(&card->cs)) { DPRINTF(card, D_INFO, "initing chardev\n"); qemu_chr_fe_set_handlers(&card->cs, ccid_card_vscard_can_read, diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index dc145a6..94b5c34 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -484,13 +484,12 @@ static void usb_serial_realize(USBDevice *dev, Error **errp) { USBSerialState *s = USB_SERIAL_DEV(dev); Error *local_err = NULL; - Chardev *chr = qemu_chr_fe_get_driver(&s->cs); usb_desc_create_serial(dev); usb_desc_init(dev); dev->auto_attach = 0; - if (!chr) { + if (!qemu_chr_fe_backend_connected(&s->cs)) { error_setg(errp, "Property chardev is required"); return; } @@ -505,7 +504,7 @@ static void usb_serial_realize(USBDevice *dev, Error **errp) usb_serial_event, NULL, s, NULL, true); usb_serial_handle_reset(dev); - if (chr->be_open && !dev->attached) { + if (qemu_chr_fe_backend_open(&s->cs) && !dev->attached) { usb_device_attach(dev, &error_abort); } } diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 115efb9..c597145 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -273,10 +273,9 @@ static gboolean usbredir_write_unblocked(GIOChannel *chan, GIOCondition cond, static int usbredir_write(void *priv, uint8_t *data, int count) { USBRedirDevice *dev = priv; - Chardev *chr = qemu_chr_fe_get_driver(&dev->cs); int r; - if (!chr->be_open) { + if (!qemu_chr_fe_backend_open(&dev->cs)) { return 0; } @@ -1366,7 +1365,7 @@ static void usbredir_realize(USBDevice *udev, Error **errp) USBRedirDevice *dev = USB_REDIRECT(udev); int i; - if (!qemu_chr_fe_get_driver(&dev->cs)) { + if (!qemu_chr_fe_backend_connected(&dev->cs)) { error_setg(errp, QERR_MISSING_PARAMETER, "chardev"); return; } diff --git a/net/filter-mirror.c b/net/filter-mirror.c index 62a8265..6043549 100644 --- a/net/filter-mirror.c +++ b/net/filter-mirror.c @@ -163,7 +163,7 @@ static ssize_t filter_redirector_receive_iov(NetFilterState *nf, MirrorState *s = FILTER_REDIRECTOR(nf); int ret; - if (qemu_chr_fe_get_driver(&s->chr_out)) { + if (qemu_chr_fe_backend_connected(&s->chr_out)) { ret = filter_send(&s->chr_out, iov, iovcnt); if (ret) { error_report("filter redirector send failed(%s)", strerror(-ret));