From patchwork Mon Jun 26 16:45:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9810091 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 7596860329 for ; Mon, 26 Jun 2017 16:48:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F3FD2811A for ; Mon, 26 Jun 2017 16:48:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6323B28546; Mon, 26 Jun 2017 16:48:29 +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 0C0F42811A for ; Mon, 26 Jun 2017 16:48:28 +0000 (UTC) Received: from localhost ([::1]:47629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPXBb-0002ES-4j for patchwork-qemu-devel@patchwork.kernel.org; Mon, 26 Jun 2017 12:48:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPXAD-0002Bo-V6 for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:47:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPXA9-0002wj-VT for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:47:01 -0400 Received: from mail-eopbgr50101.outbound.protection.outlook.com ([40.107.5.101]:39904 helo=EUR03-VE1-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 1dPXA9-0002wB-Fd for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:46:57 -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=Hi64ohPpTMPIBk9L0Md9ZjGKRGvWWIZ3+IZkUM5imC15pwMyHoxunMsEEysvhQCuIF4EbiyRSZZ2BG3be1zNpXTFGKHqK/s9hYI5sR4mZtvPVGALZ5FJyVb+pli8uD0ZqTHL6x+kBayfUqz1vq9NG4Cs9A0BCyy2svK7v/8Vs7Q= 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 VI1PR0801MB1998.eurprd08.prod.outlook.com (2603:10a6:800:8a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Mon, 26 Jun 2017 16:46:47 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Mon, 26 Jun 2017 19:45:42 +0300 Message-ID: <1498495550-72357-6-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498495550-72357-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1498495550-72357-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HK2P15301CA0013.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::23) To VI1PR0801MB1998.eurprd08.prod.outlook.com (2603:10a6:800:8a::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6dfbbc7-0bb4-4e07-4d19-08d4bcb2f1d9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095); SRVR:VI1PR0801MB1998; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 3:ntXrR25tvT2a+ra2b8VOApzXfXvh9oxOVZhVRgqsNSlWNTLHZh4QfmD8/P1KB1cKbzDAOPA/43SHndq6vxiGwTcUkOXN05ynQVx6R2UJSj+gIMyC3un8pKuseh4DdYlx+4DmqAdUdULjfm2TVeUzScz9wc36LmXPo0zEqLt8n9PV0xaQryX7k3cpxWrCIy2Nm71tyCNvwLjek3zbe+H44woKDiBGKev4I6NkCLO+ntmvrvtlCDF/qmvWMjWDSbZifnesTxNFHLzYaNdO2Y1kiT5M57Tj9RET+4dBaH4HtWH7oUhlKwnwfHdAs+q0Ih7S7vAlq/XRNUDEcmt0aeZZw5eruHfQ1quENMoR/qeNNBj6+QvLRQSWvlJs8WyoYcMBUT9XDfbm+Fe5TKW1/Ky0srpaP72jFAyOyz2mmaM8ngE/ZKUv1rHJPUAurrEwsXbK8rhi8gvjmA115G+SiLNTw7+z/zZKq5NHWpd/UZhv0LJ0ZCObCXBxAUokB3Tfuj5NDlX/HUN1WnqHNcQx08wcXSTx7hrV4WMr63LZ3S46DGmxRrEnwbxq0o0aTEUXNV6ClOASrnwftGSpeLmRuqMR4/PDh5r5I0QE6P+b1gYiqWTM3exG/OcbU2IFQDCfm+1XI5Ck/a+REAMgLRH/kXfWWX57qSWEKk7DnAeqjTsqdhlCFtAr9XoJvobtp6/mpsGr X-MS-TrafficTypeDiagnostic: VI1PR0801MB1998: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998;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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)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0801MB1998; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0801MB1998; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1998; 4:QT1EPfnf1VSuS+KrusJv+8drndSLMLBbAqN0wMN6?= =?us-ascii?Q?eDnyZi7l3f0V2+tsa0ZV5B9uLyGZ9AP4riYKjLd/bSq5NvLIyvjXK2gqyuIL?= =?us-ascii?Q?zSZwH7lLBsXNn468KZ87JfFG2Re7NXG8mUOjSb3vERqwoPYce5QtHZNx/RmN?= =?us-ascii?Q?lwo9YoK9w28dfF4PS9UjYCSU8CcWj1YoRFh06djm/o2QG6WwnmK73VJnDzhf?= =?us-ascii?Q?0MShH59E4fke+FmoTN0PQ6L1718+5Vu0g6nOgpdnw1PMDto4c4lP0FgYka9d?= =?us-ascii?Q?hZWk4PiQoKT0ctMWnrZRsIq28zPDnhD+MKOnR2rAZepejamaOKXWJrdwN3hW?= =?us-ascii?Q?rkajohXnJCGzl5EXu+iZ3PPkB7sg4lT/OG6KJt8nkgl6thu60m5uc/9On2QY?= =?us-ascii?Q?BYTseCdZ3HaZSTAbckiCS4rCj7rd9RIOjVn6+T3YTtBvQ4oL90kiMbh38gHM?= =?us-ascii?Q?2QONyOrZ+8tvk8tWoRv1C0pgbU2ipl7DQmgAcXg0h5+uWQuthd1Y1/WW9FFd?= =?us-ascii?Q?zqXV5AxqRd/O3L+23tlhpG3wbszc5nF6DRT2jlZboBCkHs7cAVKr2cF6xOlv?= =?us-ascii?Q?PK9hzlfXuYSfoclLfo36f5/0XARMazK1khQ6nmnMXEWqY0RFz9anbLp+DGTa?= =?us-ascii?Q?gPmxk3cPDRUWvzMrOKMi6xDm9XtlIpA3lsaEy61RNVB+zxlPp1mEeqBRdxge?= =?us-ascii?Q?QZVgVefF/OhJBB4cwNlSnqlucYIrLxrDdRi5eX++tsWXLZiT413A2nsuvs9t?= =?us-ascii?Q?xPnXZw2pR7R/OsNdUgqi2wOCtZBaH/IRRfeq3smlVLsJnW8U/FebVAyUoVXF?= =?us-ascii?Q?sFyox8QjWJCUnq+UtG3IOiK8uya4oX4k3588mDSC66qgOccMDuuZ6jjVQRB1?= =?us-ascii?Q?GqpcCkGyPPy0KNsMXmn+B2WExSYIWifQ5Oy45NtiY4lCSOAOOn0DWoItjC/Y?= =?us-ascii?Q?xU5GVwIjCOvyKfUIpQZXFe1FlDA/uMhomr86MiZdQzIU9ntrhi38HYXglH1A?= =?us-ascii?Q?3buOoA8660owT5IJCHqyldpYxGU4ou1uR47rXwvX1p2HgoM8VGcB2IZMX1lJ?= =?us-ascii?Q?/HeaGsE4+BAs4djvBRWFOkK8BdjfwHXINDScY+NJnwcKdv4P024n3gIwTmMD?= =?us-ascii?Q?dMqQUVPJglHJ0Vqj69TR4JgPc+uJGuhOxsfZjuplrosWGbDzLmCMnvV5OU6/?= =?us-ascii?Q?xJAU8iUXVSdBhHRTnTjEkSUj/6GFFU6sC4KdVG2msLcumGcXRLuxO/8L9X65?= =?us-ascii?Q?3+ywZ3asWOpV+8KsIKfKGTPz/EI8X+yUgYuZnXLSvY2d+5Q3DnDEzqb6x+7c?= =?us-ascii?Q?aA=3D=3D?= X-Forefront-PRVS: 0350D7A55D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39400400002)(39410400002)(39840400002)(39450400003)(189998001)(575784001)(86362001)(53416004)(2870700001)(478600001)(53936002)(6486002)(5660300001)(50226002)(5890100001)(50466002)(42186005)(36756003)(81166006)(25786009)(50986999)(6506006)(76176999)(3846002)(23676002)(66066001)(47776003)(305945005)(33646002)(2906002)(38730400002)(110136004)(2361001)(6116002)(107886003)(4326008)(7736002)(6512007)(2351001)(2950100002)(8676002)(6666003)(6916009)(21314002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1998; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1998; 23:aBYEd+VqFOSlpHYp3xd7ZKtibnXyoTFSSHCmnks?= =?us-ascii?Q?m15gbrt0yJgSe+FEiOafaxJjcQO65pRpPfHFx/XiC4PW6WLth8KjuX4qGjyi?= =?us-ascii?Q?SvRABegEMhe997dRn6FOJCinFlJMgUF2kJfTThFro6ZxGQsuqPkCQDApBrtU?= =?us-ascii?Q?ksqJf+dM/bu5gn6Q1fJV5OKIbNXJl9ZA/C16lPz4nkXJEJR98YtulLpDYXwZ?= =?us-ascii?Q?YpFqS3ItwOLt8q5W51LA/rg9hmPj+R41Ak0ncACVIk3ES+51trsy52XxgoeJ?= =?us-ascii?Q?zwJmWt9Ev+B1vNfRgn2LsOi0H/zxxh1Q4O2MRmMO0WDtjso+teSmJVULnZKD?= =?us-ascii?Q?i1rk5TM3QK1shSEQ4PbgAcLAfCjCHUy44cNjxdW6D0fd30V6dyW0QQKnBjU8?= =?us-ascii?Q?l6RCTnWKE4AobztRDW3ostLoQil4JWsAi7qXtsP5GpWaM+O0vvlPNlUKG0kl?= =?us-ascii?Q?fvsmMGAZ2xkXLg5JqMmktbCz0lhlM/igQ6G+DK4b4cfctbr6IMEIZ8jNlsk9?= =?us-ascii?Q?/EYbZHuz257GVQlHYWbmFM9nRzx96PgNwjbGy0wZ72L69BoOsJX+ybBHHEB5?= =?us-ascii?Q?N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titnwyX0T6p38GBNzKnj+2g9fMRHNEUR6F7PybZPFXZmQFs1FF/LHVFtdTLOaRnOeg/cjwb6Ur2NqLDNXREn8jazkq35m4SpKvccaZLwKZ/jSquOHWP4PMgllmP48t9nAgpG+7pRe/a/Pak5zUPGlpdKsdBKpuxVkRCBxx9wYrdrJeHqMx7HUSib15O1335WRdqmdgaLAa3qY/OS0CMFTrIbnR2XtAx/GlelHvm7hI24EYqay5mGNDQBi0pwyGcSxavGahqPAsEfQr0tiVib/HYf3gd7UA9+f9RxVcAFPZoy7B7XdIOKcj/mVmhHCBHVEFuUiaoToAKH4= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 20:tanB6dzaNwc5s1cOy1ZOjSecNm5Ol7JovkJmzgiiq4MIp1j96/CsTxz9yqHbIQL/VNusALPt+ncglYEqdnWnkGbKKycJG8GCpp8HDhi/H7kLVow2ojV11EGPTNWSzVGJJWdmKRZIGg/SWxWyy2i71ffBEg2KlC2CypwEcfMrn7s= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2017 16:46:47.6801 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1998 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.5.101 Subject: [Qemu-devel] [PATCH v4 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: pbonzini@redhat.com, Anton Nefedov , den@virtuozzo.com, marcandre.lureau@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));