From patchwork Wed Jul 5 14:01:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9826577 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 9232860317 for ; Wed, 5 Jul 2017 14:06:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 741CD1FF61 for ; Wed, 5 Jul 2017 14:06:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66A2C28506; Wed, 5 Jul 2017 14:06:00 +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 40A0A1FF61 for ; Wed, 5 Jul 2017 14:05:59 +0000 (UTC) Received: from localhost ([::1]:46393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSkwI-0006Yb-96 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 05 Jul 2017 10:05:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSksw-0004j2-1R for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSkst-0007kY-Tt for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:30 -0400 Received: from mail-eopbgr40113.outbound.protection.outlook.com ([40.107.4.113]:64062 helo=EUR03-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 1dSkst-0007gG-Fp for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:27 -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=t1v7YqbhKx3tij10NwDVmuDor62Udd60QiuZnYsV6oo=; b=Ju+IXB9o+09z5HMvSr9St7KrOYszdKAW1W1T3Kc4oTOqUq4foCfZvAf3t5X1/V9rzz/8ZoCK5dZKvbm7DpDIZUoN9xjPeJMQJ0aIXhI7S9X0D9om7ncW1qxmzCn5vpRVCUIu3t9uk/aoX5Z3p6gk2G8NSapUrLRZ8iY6dr7aNvM= 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 HE1PR0801MB1996.eurprd08.prod.outlook.com (2603:10a6:3:50::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Wed, 5 Jul 2017 14:02:24 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 17:01:56 +0300 Message-ID: <1499263324-15184-6-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499263324-15184-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1499263324-15184-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR02CA0007.eurprd02.prod.outlook.com (2603:10a6:6:15::20) To HE1PR0801MB1996.eurprd08.prod.outlook.com (2603:10a6:3:50::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3eac2e75-e1a0-4a61-5fcf-08d4c3ae774e 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:HE1PR0801MB1996; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1996; 3:9xj+S5qykwQUMAnRFD7wUPspd6GB4vprCXCD2/xha6FvH4L3RIXeJSaY7Ebc/4/GgxzXq0ec8lKCkMmwbywL2PrvPsd8K1puuPGM+JC9b5njGg1DEnwLnH70o+taGS5m2sSOxhd6h1H8GgZRyMMhLbycF1rCog0wsMgC83lWzwBFVVQLp4S2l2FRRCMVJEToqfY+65JIHSCzHlW3H0m97bNptyYwz0EwW8g1jjy4mCpCXzSdENw1BlJ40e7rADvrzgVIaOXG1t4mV0K1RUVhrJwDEsqQ0K3ff9w+N0EuMFGKDouRUDU0Y29PjL1M4dF8Q0ZnX1u2K/wKqMIUJnnV5tMOvpe9BKDLj/6iAoEH65LsqO9sniD9LuKD0IwVkbln2tj0mcBh8Y9Txe6/c+DNcgFxfMLqRPLqXJC6OZK5F5S/JNgMrv+J7rHasq4dkxdMZOQeiAv2UMiVF4qQaGq9FQFhbeeBnrl2ZeHPUzzpjY3JZilgzlw312gmST6cGQj29MT6yQ5Z6GWf1XshEGDudYDJYJW8CtN1A6hq6euVwiWBJjhZS672PBuELjbUNl3dIOTek1kHVW038hyTtlbbmU8VlyhIQNxUkmWqiXX79/dhFpVxWRBIg7MfVBc4RONfDrCHtQ+zYmMsf3tijFKho/a+pm1o77ycd65dBYJKzbL9n2rZ4wbs82uk8YbYa/ZgH5bqyKzDdsGl55Rtdhnfe+Z21GlWRNX++32aLuEzw1B9bVeZZci+n81lYjVTiKdI X-MS-Traffic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qkvS0YRZWVBrvoNttjj2yIOBs9lTMo8hjU= 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)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6041248)(20161123560025)(20161123558100)(20161123562025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0801MB1996; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0801MB1996; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1996; 4:rEZCxuG993KOzr442Igq/7nE+Z+yl4PEuKTp98Hj?= =?us-ascii?Q?xCyvjBqLGOUp6/U1T/XrrW5VZ4SfUA/pNe5IbXTI6S18H+hldrQ+hK7OF3dF?= =?us-ascii?Q?3rykLEt0aCOdE0og8eeOpQaPeBYT0jHmMuEaAVv3rOyW6Z8bEph8gWT//mI1?= =?us-ascii?Q?DpJ0r7RuXlitULFhAU+Sp1COwSIa9pIanvLPBeHr/nHQC5Bv7dcPe1W/c4ns?= =?us-ascii?Q?W7wLE3QYI9IwSuNZZb6wInR09bibtmKluIgmHtwBa3PSk31wzx4m48ouANsS?= =?us-ascii?Q?66aCF/o69vZFrmqf9cjeJ14W9v0nFojHWX7cmC4n3xTdRnB+Vqptk9gsONCD?= =?us-ascii?Q?BsLGBH6/gEpOZZR9t5BIk0buwT9C53vcIsGx2ZPOSKssfmwZGzXkxtM2WYOI?= =?us-ascii?Q?6bU4OISyzLSgT5dOcDJlrok+o/diMADVLf3ewny3+4RREDIElBg9yE3gA7BW?= =?us-ascii?Q?pzkrNtUmicNDYgfiTfOv0OyLCXTC75hwjZjL6nloQRFu2pgKpiHyhiqcwT68?= =?us-ascii?Q?UKYmLtuzFTwMWYKBwceW61DHQ/kktHhjii2EKzofdL/PXamtXtW9vpFphdPS?= =?us-ascii?Q?PDTs69kB9UmorjnxUdTY8MK8g+/GiAl0Nc315fwV7F3f99STs9+A2gOnLifm?= =?us-ascii?Q?x3PUesWomxyXJYGnGBQFSUi2ky1S0aFBExbQ6SezDv6Cml6y6AU11TIBUma8?= =?us-ascii?Q?jPUVoGQVqr6H2/yvVBJ2T78eoP0g7gPuEolAi3fDGuntZkIfX0bSPJzBto7y?= =?us-ascii?Q?niKUiXzqznxUWtUxPsEHBff0zL0ELbQfkzIQaiA396T11I0NRodWJhdZQkIR?= =?us-ascii?Q?c5TnH5wMMpeJRsc0fS0OZapppvizhy5jowHJzHaY/k4xXSoSRo1reH79y77U?= =?us-ascii?Q?bvV8n/kGW0TOkuu3itcEs72XjyD/Cf9bp+nnL/PpmX9i8WoFMZ5dsG4sR7Dp?= =?us-ascii?Q?ccubyN6+ewKLpZaDUIjnrhaAuA1kHSK/mp/+6Et16EvkOOoiMCaJcl2D0Rye?= =?us-ascii?Q?AkEdZYV760+bY1P4OBoxVObo+zF8cMn1KvebpSFtqPiPFfplpAIyD4XIIyGH?= =?us-ascii?Q?dSW7Du7S601nBlXG1+5Fm0kinQOj0t/HUWCTseeb46i3ECbqXiAU6cLIhUbM?= =?us-ascii?Q?YUxlYJ1eQdlf1ME4BOt+WpJkTAispalq8QsjJ2iWq/WJ83Z/Z61CD7F+EWiM?= =?us-ascii?Q?eMeeDOeVp6qkUVnUPLtVz0uJVZR+pPWWCbOgukJnntVdNZIOQC9sdN0sH7/d?= =?us-ascii?Q?AZyPKMmxdm/U4WziRzNhDYhbLjYWZh44hYDye9TjzOYF2LUPBg8e3bcrdMmR?= =?us-ascii?Q?4A=3D=3D?= X-Forefront-PRVS: 0359162B6D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39840400002)(39400400002)(39410400002)(6116002)(575784001)(3846002)(8676002)(2950100002)(2361001)(6666003)(33646002)(2351001)(53936002)(86362001)(2906002)(38730400002)(107886003)(110136004)(50226002)(42186005)(6512007)(81166006)(4326008)(25786009)(50986999)(478600001)(189998001)(2870700001)(76176999)(5660300001)(5890100001)(6506006)(6486002)(66066001)(50466002)(36756003)(23676002)(7736002)(6916009)(47776003)(305945005)(53416004)(21314002)(309714004); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0801MB1996; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1996; 23:8pyKVpN2c6pq3lBbVhrvZcsUCDPSqojiMjhlg0B?= =?us-ascii?Q?QpokPRRDO0gpaXPChcj97HvsK+hErhGU2SnEJlq6dsvdFfVk1UngbocpMqDO?= =?us-ascii?Q?WJ7m0ig7TFJQRZP+I8FqzdHdg02K3fYE6TH4m7Eigz1SaxPd5eSg7lSNtOiE?= =?us-ascii?Q?U5MSHcrblmofh2YyejUG1Kj41WvhoGDo/G9BWA8UpQw/cdZqwGC1OW4OwGfL?= =?us-ascii?Q?jh4b1RIm3UxNhLYdnLxq5yGwseugRb4FzdNG/OliPX68EeDglSTV5N5cgFKx?= =?us-ascii?Q?cNU1bIe6p89OQ1prU+5jS6IILqWrK5b7vFQHalrP5NV6p05SQLylAAQ7nP1D?= =?us-ascii?Q?N5gDWs3f8v53+l2xj1FySCndAZZoakiI35KNsLQZs9J9kX2opNXb8V9235Vf?= =?us-ascii?Q?5lD6CNMCVm6urieUKthSB5RMDwHs+5OWV4wBQwZcllpsjeqoc27C68S6qnF9?= =?us-ascii?Q?xIt2kqsETJ9qZ/g0Uld/reRIqkAvwS7RwtXcpSZqT/bXIm7YMi81UNShZXlB?= =?us-ascii?Q?LPpGT58Ft6qqOZ4gPRk3JG1TFNpyT7K97ua5Y7Hnh9O9p8iRDoAD5vwRgDKC?= =?us-ascii?Q?2rqAa8sx7frGgaYZG/ypVu7dQAAoxAoV4VRbxnXVO4kjzEZfdFJohUvRsskH?= =?us-ascii?Q?PzVgyZ1G463OVGBhp48yZq3wma6rctr3Hwfx01dddnmY7rlzAOw1jBgFZzK6?= =?us-ascii?Q?muM74kkaF0BMI3g4acW6NkHU945ZFjbWCv4YS+O5cFZ9qdJXeFWewreJ2312?= =?us-ascii?Q?GLGFokdMifObsqI51V1rDIPwBfmhKzOa8CJ2MhoDM1JVtlHfRp/Jct3VLLGn?= =?us-ascii?Q?Ctu/phoVlvfMlyul0sD4cSqp+bpOyivEA2gXN1ulXeamKrRe+6kL6JCOI2yE?= =?us-ascii?Q?jEMMDOwe3+68D/ARan6S3ibTv0zBXlnlEkNEhVEmquDP7WOpoxhfGptKDkLa?= =?us-ascii?Q?U+wuzV4LDAxxwU7HWfx19fH2rWt4ZizhRC0TcY8Oqte3XvEovDqW9BWq1yMG?= =?us-ascii?Q?4BVo/UvYYrs6IsWBaWV00CCGg7QYT5Wm/NSg3x+GLusn2KzanvwN/R+UouPz?= =?us-ascii?Q?GXMpaImV9hVCsmem0Y2NCOyxMatASfcGlOpqVbdnB/V+4SRqUDWYLYXB3ETQ?= =?us-ascii?Q?5d3LH5wCowhikmnDSGdbh3JIppP6n/OcnRk9OMkbEHiV1b+nxQb20fA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1996; 6:e+oCqopw7jDicnJiGNLdhuyjCgjnjkncDnMhKWL2?= =?us-ascii?Q?OlRs5mKMe/MscfJcEAnEEHw1NtlJ9KHFKbsSvrWbIC3+y31DHNkADDSHbBUo?= =?us-ascii?Q?D3FQZCa0SwWE8h4mukyXtLTRmGqja7ADSzfZTxQiByDcniFW/PeiLlyq52Vo?= =?us-ascii?Q?AjTU1r4E50hs9OW3JyRYGsEc2e3ZC6aZ3aPFXs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BfkRYKzh2hOi+dfMvBCuri8KtqwmtKWVrULzHGIXMcT7FFc4+VspnJU7M34JwyYRoFSWSt/LhvLTpCNfUs2TAmtuzOO2/YmEc2k9TbVk+hSXW5LmsfQwAcMBNUUEOiFv/nRuLokUaKf1T9ilZSwcIqcIJgJDNwd/G0Rjv+2FEiFIFfrtFQEjXRi+6jNArek8yzx5azST8Hcj+zUzczYgBQOzy2FNmq0k6YNW8Zvam+eNmgdNhpGKEPhsZCsKk7xO4tBq2yNJSzz5jyizrjxN2WLmHVovPgXV8h+5XKqM8XxAK8giPWK1VUm9DBVHd4kWv+ddGFgBeGmbc5Mo6lQN0astmBOnXrAlKUEMOfdj75Kb5IJtu+dB/GNYd5NV0fFPBM++l3dsHq1eYZF4mRuaZrxdpZ1eirX8rEKc2NTRW3wo4= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1996; 20:N/boZOfjkM+9jDa5FYTB2RLc4itWZ9NsnnFjVezHQ99d9ex2FlmH5zA+6G82v4gFb5GryOLS/+vF89mELRdxk3hbqhcx/23UyNcmU1CgTMiPR8DYo+kdOKsWMydY8iZb+WYEKrKkJYbgR+L7nj8y7TNvFML8GaAmre1x8dS88W0= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2017 14:02:24.7558 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1996 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.4.113 Subject: [Qemu-devel] [PATCH v5 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/sh_serial.c | 2 +- hw/char/spapr_vty.c | 2 +- hw/char/terminal3270.c | 2 +- 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 +- 22 files changed, 38 insertions(+), 28 deletions(-) diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h index 385aa99..61c7f97 100644 --- a/include/chardev/char-fe.h +++ b/include/chardev/char-fe.h @@ -77,6 +77,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 be96fb5..3120441 100644 --- a/chardev/char-fe.c +++ b/chardev/char-fe.c @@ -193,6 +193,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_connect(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/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/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));