From patchwork Wed Jul 5 14:02:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9826581 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 07BBF60317 for ; Wed, 5 Jul 2017 14:07:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD5E9283C0 for ; Wed, 5 Jul 2017 14:07:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0BBD28504; Wed, 5 Jul 2017 14:07:07 +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 2FED2283C0 for ; Wed, 5 Jul 2017 14:07:07 +0000 (UTC) Received: from localhost ([::1]:46401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSkxO-0007pt-9m for patchwork-qemu-devel@patchwork.kernel.org; Wed, 05 Jul 2017 10:07:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSktE-0004wR-2a for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSkt4-0007sL-Ic for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:48 -0400 Received: from mail-eopbgr30096.outbound.protection.outlook.com ([40.107.3.96]:45373 helo=EUR03-AM5-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 1dSkt4-0007qA-22 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:38 -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=E/0J5773wSnVCShuD07auR0rluIJmOWpztaE3bHLZKk=; b=NWcWkKp6RJLZ1K2YYKTNyK4pM5DLT9WaYiRzH3BLdZP2QSOegc3U7W/2iG7p1MZRwC/UrqUFGR0STmDKvdjehen4WcA8I20XkdFbkQpSjwo4DzTligv+D0KHQ8ueEBF2Gn6m6lkzArtnRjX23OTM5ZnDozWP379WkTDFD8/UrWI= 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:35 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 17:02:02 +0300 Message-Id: <1499263324-15184-12-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: cb977ced-ca23-475b-bc7b-08d4c3ae7d78 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:Xv0YL61W7yX1Snl+eZD+lqzSmJEPSeAjL/S0Fr+VY8gUVab1F0nxlkgxZCG2kSK7yutb6k65bD4G7R4cTZ2hIr/OMW5sTZtaKZDpxhJvvmk8nlXPHcR2hSQwvLOXo/34PY+7S9pt9QMfbM3ZCDcpJMxwA5u2sKbsUIZRxtGbpdSTMx46ytXLj4sNmAvDuyFxaWnmWW7yT+n53vLXOEEtYu11pbX2owiM77QDf0U2dcemdJH9msTyWM7V4+DCejAOPrjQolZlWbiraVz4HSRc9mewOVnKYCkmo5Et4agfYiOYRrYv06Iwua2cyiE/roGP9zEh922op3l0egUU+E8niUTVnWrHV0wuSlvAd/fbtpfulEhb533Pj1TOUgoKDdixoj4gjGiaNtQ04KZfO2giW0iE1P7c9UNKV+ORfj08dXR2fDHp7du26MgoWpKaJToMnfsDDzQ92NCHn36GJdA6364jr24kGmeI8ev/xRcpIwSbyCUcGy8wy7Ukha4jsshECUTj/pCju01Pms+ZG1GMRRItXaIJ6BvU3/Cbrx/+9cWZWADFpIvxmntbRdXo2up8oiCcuqzpDXIgeZ6hHwjtpUYxvCBLWzHr34LfIBtGiKZpdu0tcmlr9CCL/Ys7IPehauiHumuXwrH4yI9gLBMIVVbrPhVXSA+G7SMVEwipTKTw54jYCUiFD7oq5OOaHxcoD2FIs9rqN0Hmj8XLN98oT0u17QfkHdx5UGshfd4f7M1a8hOCEeTuZ/eWVKOBYGcb X-MS-TrafficTypeDiagnostic: HE1PR0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Ilr0I7Mw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228); 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:zHCRDylvXpVWYMpowGC+5nnAtE+jXfIwBHh9HVTU?= =?us-ascii?Q?dlhBoWUnAlto4R1kui4pCgNUiP15yPPj5gPf+EIEY356mZB2eOcrQk8sME/B?= =?us-ascii?Q?3QJs91TMQi1UMqNImcOVm4YHfdXXT5gcao5aOrSG7UyjU4UPTfgHV38S874j?= =?us-ascii?Q?aSIlndxv1iNG4z6jFtR2dUqUrkTEdBAi31KFy03L8tZBEJOjO0PUGfKlGSSb?= =?us-ascii?Q?aISHiWngsLPdWZsg+OSn0nncDY1LmW6FgWC50Qrhb/2OHfjPuPIzfayG0aqw?= =?us-ascii?Q?660fAfmLGWpRp9sBERC63ydrweGKUSQTNFxBIbVSv6kY0NNsuXNRT3mdCtyz?= =?us-ascii?Q?NoU0EJ/2UXRL5IV/QTe673P4JyCTVdDeEqbQdHMm3pdnc4xYfkPTOcf7XhVS?= =?us-ascii?Q?MQrQDROONtd2lGk3I6FH4KGdMY4avUV4ws0/7NJZBop9cZnud9rSqk4EzEGK?= =?us-ascii?Q?YtLMorY3RW271m7jL6qeBjJ0vyIcBfErvMkLbrRTMOV4g3vp96O0WsBrHcSc?= =?us-ascii?Q?JU0ETDTIdazp7WwkvaiAH9IvVruRDGcl8pLEh+x2aI4dRRPXdO86oLvHNzb6?= =?us-ascii?Q?6Do/qoySdOKpYtUGEFbACI6lpUjp6UHkNVP+cAI1RlptZp4xhbux2NJe9cHw?= =?us-ascii?Q?u4ZT1KOlPLm7RWFYE1WluJNTcnqzdJdnBBZElNOFT8ZhGHDR0GrEMkmo8PI+?= =?us-ascii?Q?I2azV12oBmTvdsF+RRKNHUkRB3V8+9cvh/WgzrXcdLmzh/YJEriimVAyY5fw?= =?us-ascii?Q?4j5c13PikcRHnMYgbFWAT4cSbFwvzqZSzdAON03dEX7ZwpFJ27jVef8zruup?= =?us-ascii?Q?SfekYrJCephiC/CQWQJJy2G7+4oZ9eb3wx5pfZkQqnoJvaPK/BZuR6KK+Kiy?= =?us-ascii?Q?2+Ddlq1WOLNMo7+ekgdlypArh70BnT/c88+yqoEhKB6SPBonWgD6/0CmQUEu?= =?us-ascii?Q?3EiMsgDzD4itZfaP50K5ePjo0FTAYkrAcmAKv+NtY84ofyBsLSPmRms2hYYl?= =?us-ascii?Q?PCheJZoeq65hRlL/CAqsDFbV1FaxGcLByqATMpaVYvvVOUD3EsVqvyxi+CAK?= =?us-ascii?Q?f2y8zwRdjECNFo6MGI+4ZP6U16F0dJScI8JqVO3SX4nxvzgib5KiyYuvIqMx?= =?us-ascii?Q?Vzz7beJczX7Yrscmr6AyANAG2THhLtAc1Wxheb9l5bCtrI4lPh2SNKqYsD06?= =?us-ascii?Q?jPxEOLDiGJm2N2g8C3dOgn3XTj8P4gBi/U2Joav0t/HY4uv18Bz9yNDeyg?= =?us-ascii?Q?=3D=3D?= X-Forefront-PRVS: 0359162B6D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39840400002)(39400400002)(39410400002)(6116002)(3846002)(8676002)(2950100002)(2361001)(6666003)(33646002)(2351001)(53936002)(86362001)(2906002)(38730400002)(5003940100001)(107886003)(110136004)(50226002)(42186005)(6512007)(81166006)(4326008)(25786009)(50986999)(478600001)(189998001)(76176999)(5660300001)(6506006)(6486002)(66066001)(50466002)(36756003)(7736002)(6916009)(48376002)(47776003)(305945005)(53416004); 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:VGOv4U5+CcQu2Hn3nEOxDPnKO0ACJPe88JeQSgs?= =?us-ascii?Q?vAoyTbuX2/7JViWdZbq3rm0yMUuh+zwWXNBQ9E9G0cG7dHPMAzgleHQxcUhR?= =?us-ascii?Q?EFzgxjklWnU8UJU3Ve8eYHihpqo+4CmH9RhyeoM5Gj34wndbLMiFE0+8Nj7/?= =?us-ascii?Q?sEQ2CKhWQiHwu1MNNWc71/ylSBOeZedVUxoxqSSjb/tMf0HqPzPUEtstLbx7?= =?us-ascii?Q?dfXFe1i/sotE6QM41DRLwQKU6lgACDwGiLsLZJg95IPqel+yy4RYA1cOgaWL?= =?us-ascii?Q?hGAawW8WFclJ6CjpqQ1DaLnfsN9EM8opLcpj6N06Z8Vw+fhWnr2t3xyho0La?= =?us-ascii?Q?k+u3ugdT8Zy9Y3b+sN4cRhJF8z+HkRb3N+1Sw0LKVAqRGKwfQIYXmC1jZgfP?= =?us-ascii?Q?PF5+dFIuuEUGteMqqlROiUCmVXMfuhc2phpCcV196nDNqMPRouItrSHl65cr?= =?us-ascii?Q?XgQXl7eFlRkV49liM5st02a2aNp+FdGaZtvjpNni+0nYOgK/JxOegj5VxCes?= =?us-ascii?Q?RrYw2JmttMPWYxOqnqP1y6AcB5p9JaUiLMWGVW/BTgH/xrf82zrJu6Cq1uM2?= =?us-ascii?Q?lvKVyLQin/TEt6O7TOuciZ3ecEa66yL+voS5TupxhfZ9Po18b5kYkfKFfC5/?= =?us-ascii?Q?6QAsqjFXwDVQHw+T4V/JD3GeLfgExc9L6OqQxNx1kdCUgfQ00HNMQaG67Jwa?= =?us-ascii?Q?8w5h+v2pBHPN93gZx108uAQqHIQxeq5dVMUlsJq7syLe2Z8y2BwAG2YPBaB8?= =?us-ascii?Q?1nxffetezTaDjYMml2bzFULDJpI0GJl3QSOpVL1NUhwaXb2hf9Xb9HTyKSCy?= =?us-ascii?Q?ccIGj1z6jFQI+QLvLWt6L8PNnfv/5KmiaZX2JBLdbbOgsut9ODBZTzvfUA6P?= =?us-ascii?Q?2rGLxSBDnIPBS1bNiZMsgmcgJsQ5YJMuC/I2yaXQVfzdtLjim3uKeAFso3NC?= =?us-ascii?Q?sWSP1aBnEUXmRvBXlOSpC5GDEBdoae7h2z/zAngd4kRidFxSRwAg8bnK5MnA?= =?us-ascii?Q?OGLTMlsluEKCT6m81hkEAkIvflkxK9OHmWEBoSxXb+bef896jCPKmU/UtT3r?= =?us-ascii?Q?65KeZCbVjKqGZw0unxH7Xv2B0eIpU?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1996; 6:JmCmEjXtOrJsUt+Hmr6sR4I26syxW7U2EE8Ma+YV?= =?us-ascii?Q?b+3+KUy8XqicoFfAZn+tSbAhyLutzcyDSUmmDUaeQGa9IpSB9MeNPM+hct/I?= =?us-ascii?Q?Bai4dUN77KmSy+ShOyCOcwKlaGTFm5xH4051/OEwO4CoV22v91gKLO9pQW4W?= =?us-ascii?Q?21QzDuMrPHGL34b90Y5TPUng1CriHcML+xxa5d5ipDnIvWkfATQE71cLu7db?= =?us-ascii?Q?GcoD9HqBO3P3fjIdNQEzNZ5hjYzsetav34fCDULqTNY7fGAnUJxY5D232bu0?= =?us-ascii?Q?58dQfUWq+6zic0YY3BbovbQCiwx0MSeCdAK5sSlN4kb6B1oMFYiTbkyMt/rh?= =?us-ascii?Q?ll4C5xmcYAmSSXkKVu4Ks5u2tdFnYjjudERMtsASx9h0YunFGmBZiUCnKPqz?= =?us-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4eytE65QxUvPfgSU99M9uNfW4/jyyTxIxK2uhAPH5YlmTGT3BjUDudOLeHCd9dbkYdg2VQBACzRgLecZoJkxBGlUzbB3MO8BqFXc3C5Xh0g2MEn05U8EUxcfXHtuvoVr02gZXc= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1996; 20:otIqDQns6/qtuQ4jPOFiuewBWgS4zQPbaXOeb5Y52yyw4KAHhl6jKfuQ3Yg8+fBnl3+RjU6NQ7Dvsrt+bGMRhyYw7Kx8sB9nJRAbQOPu9c9sLdHdO0Oc5Ag7t+/cJWSuKPJPA7kSQZ7vp36tf6EUBOrWq2c8WpArTlJ6sAJBzjU= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2017 14:02:35.0997 (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.3.96 Subject: [Qemu-devel] [PATCH v5 11/13] virtio-console: chardev hotswap support 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 In case of a backend change, the handler functions and the watch have to be reset. Also, avoid unsafe qemu_chr_fe_get_driver() usage even though the pointer is not really stored. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- hw/char/virtio-console.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c index afb4949..198b2a8 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; } @@ -163,12 +163,35 @@ static void chr_event(void *opaque, int event) } } +static int chr_be_change(void *opaque) +{ + VirtConsole *vcon = opaque; + VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(vcon); + VirtIOSerialPortClass *k = VIRTIO_SERIAL_PORT_GET_CLASS(port); + + if (k->is_console) { + qemu_chr_fe_set_handlers(&vcon->chr, chr_can_read, chr_read, + NULL, chr_be_change, vcon, NULL, true); + } else { + qemu_chr_fe_set_handlers(&vcon->chr, chr_can_read, chr_read, + chr_event, chr_be_change, vcon, NULL, false); + } + + if (vcon->watch) { + g_source_remove(vcon->watch); + vcon->watch = qemu_chr_fe_add_watch(&vcon->chr, + G_IO_OUT | G_IO_HUP, + chr_write_unblocked, vcon); + } + + return 0; +} + 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 +199,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 @@ -188,11 +211,13 @@ static void virtconsole_realize(DeviceState *dev, Error **errp) */ if (k->is_console) { qemu_chr_fe_set_handlers(&vcon->chr, chr_can_read, chr_read, - NULL, NULL, vcon, NULL, true); + NULL, chr_be_change, + vcon, NULL, true); virtio_serial_open(port); } else { qemu_chr_fe_set_handlers(&vcon->chr, chr_can_read, chr_read, - chr_event, NULL, vcon, NULL, false); + chr_event, chr_be_change, + vcon, NULL, false); } } }