Message ID | 1496152683-102751-14-git-send-email-anton.nefedov@virtuozzo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> 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 95FF6602BF for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 30 May 2017 14:05:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8883426E74 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 30 May 2017 14:05:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D5B928419; Tue, 30 May 2017 14:05:34 +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 DB9AC26E74 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 30 May 2017 14:05:33 +0000 (UTC) Received: from localhost ([::1]:54010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1dFhm9-0001T9-3r for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 May 2017 10:05:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1dFhfc-0005GA-V1 for qemu-devel@nongnu.org; Tue, 30 May 2017 09:58:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1dFhfZ-0007JB-Lb for qemu-devel@nongnu.org; Tue, 30 May 2017 09:58:49 -0400 Received: from mail-he1eur01on0136.outbound.protection.outlook.com ([104.47.0.136]:15171 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1dFhfZ-0007GL-99 for qemu-devel@nongnu.org; Tue, 30 May 2017 09:58:45 -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=qk4+N56zFOaQl8tTAT9xQowW3cvZ2Vo57CBCXApoVo8=; b=VINxZujlNr9cdkZl9ReAKXZlO/SgsqI+GJph8dztV6ycVREGZuNae3rgNTy/E5rt+uCCIOsN4TyQCZ0FFulzUsth9cMf2JzMVWL99y7BjsBrnb/HZo5y4l6mGtkLHIqN8Sdv2nsxtu4HAAVlLzOxKh/THq8/3P5bRKHqLV3yDxo= 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 HE1PR0801MB1993.eurprd08.prod.outlook.com (2603:10a6:3:4f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Tue, 30 May 2017 13:58:38 +0000 From: Anton Nefedov <anton.nefedov@virtuozzo.com> To: <qemu-devel@nongnu.org> Date: Tue, 30 May 2017 16:58:03 +0300 Message-ID: <1496152683-102751-14-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496152683-102751-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1496152683-102751-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR02CA0033.eurprd02.prod.outlook.com (2603:10a6:6:15::46) To HE1PR0801MB1993.eurprd08.prod.outlook.com (2603:10a6:3:4f::23) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0801MB1993: X-MS-Office365-Filtering-Correlation-Id: 5a370a68-eb42-4f9d-19b0-08d4a763f943 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:HE1PR0801MB1993; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1993; 3:iI1hFNg35GhpiHeT/lzucBLD9RcHmEsSmI7vJF+ELevu+2M0KA0C/mkcBMbk3Y+MYvpSZrbS9GgvJU88TM8Np6QEvhoCZOfJFvmLLlwpfuVNAhSm+q/PW3YdN8zUaNJ6+OJQs1SSkXcL5KdI1I3y06P1U28/hiEb8T3pg59G17+gxdWNMXiEc7mJl0nOc6dKG1jEBC8czklPyuWjRqHV0PxA0xJ3/b6oKaRzbU0TEaddc2Ayu/zg34/y/gq+AqO5xwS9l2GlVxGvrL9gUsLsW6yVspvG4tgIqmASK2W9zvXbcxJcr8LcEkIMBJc623Wo8Vxcy9vT+LWzTxjQTzcYPw==; 25:xZPf/29pz8DgJWrhYE3zRR2/0GrwdAHF8lh3IFfETyA7CdHEw5LsYKlLen7maJjirk6jU1K1FdRVPPtFKUPlA3fSKDh0a75NuH+A/X0TYs8tpPZJR/kwto+KI1g0FC1a1S8aYVDllVaAxBwtLrfRC5My7/j2gqNNdrIHIXWvkAno46awcGVsYj6VMAKiVdY9qowLKaVlsov0y6idq7B7qNJoCMJaBvxrEm3E4V8P0iJCpI51OBPBZxDA3RaMsmetd+x6vT6LDdD2bO2w3f1jD5J+RLj/sTIHxgnV0igorrAEHbscJW/W1tlkZz1Pr3c/O3m9pwSEmiMd03giSAREt104AnG5Yp+BzBbP4IxRvTWKp0UL2zdENiyK9Myg8t0UwGeoGtBPivT8i4+DtiDeykAjU5mWN0SsX9526BCiwRQr0w5t6gGZiC5zSyvCHSmYTZpbo/LYrDnUeU5P3Nsiu0A/uw86LKC7C4NcgQnqbho= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1993; 31:Nx53Pg7o2W2/8Gc5ck8wCnqp/reE31Fn8Egzi1HoP7wzJiw0TujrErJLZAy2q2BstMWcwb2zLpMqD9DZPLO8L6heCLF1LiCMO2jwuY7c59elSv3FXLEnKlpJxzSRWhsh8vDP3TDp9g+TUm+/9MNK9gy23fKsZf1SBo28bgDAiyMkLcuRwqqCG3Md71AnQ8xUVt3+LP3Q6zx65Qs8D3KCW1VKKB9O7jQOM07hJjnuHDI=; 20:hC1xx++4ehe3J7PiJgrgs20n7CLE0/m2r1vTl8EUcP/OxyooePuZFk6aVtDRPBMS2R+erNDKl1hqRx08Bu0zaL2eYt3iqKkePJziqb8sloViYUAknhXbWQbORGtKPjjUEuZ22lpsift16m33OTxrB4Xg3Kgz4CzrcZy7YL38U0Z6lxvHTaxMlZ2IT7URv2yCKWE+QTvWYAqLqx5b1GoupIu7HMHAFNlGUL2sDgde8QEzj97Fj2KN8Bk4NrovTGR5pOun55KZ6d4jKzmG27Hk8JLbRQ8eu1+xa6Z3+m4ZI2eUknCAV2/F/5A59rX+udRybr/wGYtXu/s02IRMjznITEDytgxjF5Z3iM+AnbdhIa2v1DGdIfW+JP6HnMNG974EP2IuWSbE/tXjFgL+Bc36b1Cu9qA3BKBeTRBVC7ZtZps= X-Microsoft-Antispam-PRVS: <HE1PR0801MB1993A89720BB00A385605E6FF8F00@HE1PR0801MB1993.eurprd08.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700073)(100105000095)(100000701073)(100105300095)(100000702073)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(100000703073)(100105400095)(10201501046)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123558100)(20161123555025)(6072148)(100000704073)(100105200095)(100000705073)(100105500095); SRVR:HE1PR0801MB1993; BCL:0; PCL:0; RULEID:(100000800073)(100110000095)(100000801073)(100110300095)(100000802073)(100110100095)(100000803073)(100110400095)(100000804073)(100110200095)(100000805073)(100110500095); SRVR:HE1PR0801MB1993; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1993; 4:b9AT0BYUcmtn2K0TGTAl8I+bD79Geb23s5So4TdH?= =?us-ascii?Q?UPrHX6o0lzC4RxCx9he6lgl4K7LaidOiw4iIoCr11bRjNWuqyKDr4CO+YP7D?= =?us-ascii?Q?dXRk70xsp51Yeefw86V+7fQxa/zZwP3HLDJ81E4GhEOlHKQ6lw721ruE3jQm?= =?us-ascii?Q?w1rRLlY30cvLckR5UCF3eI7enNqCVoaxCCV+9+tJSWPbAd6MOMZR/Bs8Axpn?= =?us-ascii?Q?6GABjknl13oR6Yo86GAR+ac1LG216jTSOMoBUXxwG8fDhyaYINzUkg9Ju8Gx?= =?us-ascii?Q?ZMcYpkF7tm7+8h5aHeb0xQ5ey0o/1rAaPvPqfyYvXSi/nZyP/n+k1cTOtgkI?= =?us-ascii?Q?fulfSCPepCcMxZQjrrDPOitdq+1+l84fmEew+vZ5AZCcJ9mpKPLF+DpCCeQj?= =?us-ascii?Q?4UrK0IQWainETt4iQqpAgjXudcLcQ5i/vvKIbjWxqa9wYSJGGrwahss6oZ3L?= =?us-ascii?Q?8+8+3ssrtk010VCpp4fRObphWGihf4b+B2e7Loj1gzC+dveflyWu3DbJVHEn?= =?us-ascii?Q?KAwPvsKUN5hsVNvXHn18JDSpMOvkBvqE0/nP/IjQR5z3CQlhDZI9S2BnW2eb?= =?us-ascii?Q?I2lPRoUgPmzx6MyB9Gz4MQ7fEezfQ7WQ/+9zr9iKjZeVnVRtqSt+wHhqlvF2?= =?us-ascii?Q?XS/zFty60bljvE+7t0wVXOLor3I1bx9plvPRzQKWET057RxZT8sQQOcm1IpF?= =?us-ascii?Q?xuliHBYbiMd1s26xyI4omGKt18ADS0xH6UxvL2yfk/BwjZuUiaY8ql+A8GH/?= =?us-ascii?Q?3rAcujK2tFfQ/rqoJ2aUAItPYG4thjzXAJfcjlwQuyeUxcT1LYdXHWwxaaK7?= =?us-ascii?Q?TRU1e38kg4eYAZpE9M2H9MMzSnXjIZG17MCmsot6NfrDTHsFhZCTNSXbTmkU?= =?us-ascii?Q?uRhSRhVML+qWj/k3HaMmlsfxyrsCYVk3dLzH/FLFEoPTFAIg104CCyZpV6Me?= =?us-ascii?Q?IAz2PyeLN1ixUAM9dgBJPELaFB1brfpjO7Ldt3bhS08gw5M5EpvVcBNLp9TW?= =?us-ascii?Q?t/+zlMFTx5CH8Da/M2YVMC/htoVFo8mvrVwcnTMx9u2xrbACl5ej7Ukpv1mv?= =?us-ascii?Q?ZW96zhJ6711GC6l8ZlxK7T3IoJRAC4e2bzDYEsNpcz1jVy5KKjt3lhjQApYw?= =?us-ascii?Q?N29K1/zYmcLPkV2X38bGm7Yvblaccfpx?= X-Forefront-PRVS: 032334F434 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39830400002)(39450400003)(39410400002)(39400400002)(6506006)(6486002)(86362001)(6916009)(2950100002)(6666003)(54906002)(38730400002)(53936002)(6512007)(25786009)(478600001)(5660300001)(47776003)(305945005)(7736002)(66066001)(5003940100001)(110136004)(189998001)(2906002)(4326008)(50226002)(3846002)(8676002)(81166006)(6116002)(53416004)(50466002)(2351001)(48376002)(76176999)(42186005)(50986999)(33646002)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0801MB1993; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics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gotWiGDqj+Wq7ZB2JX2nfiQn/UFaIuKhI9EDtJ4bt1QSHCy6tJad151N3Ck7qxpEt7VdafObQmJN+ksHClWxCiy7M1pSy09sMRQFmvVhqu3D3fp/ffWmeA2cwFgXnj9S4vExlV/qKUU8Mm6yhJP4kf+filtaQ1D0MgnX/6jqaXvEaq/aiKibcgw+NLo04KLK5s++9POfRJfXCpXtpwTNhYhxz356vTswyCrgKe5Ji3jHzODArEsXA+MsZF4sjfKM45AhaX1g6RyFU2hS3npyvgXHkf3q4i9p5VSLyT3MFiuyZs7PeTQZl4+lmU1AufgPu; 24:CTpR1OCuih3WEOpiRUiVMfclRPoLDoqLAjfdtzGmdGCZiWZ9/sGEdHKHDPg9KTTQHJrzJym/JIxlrzc3cyVdIN856DhF6ttV5wiQHm7VBVQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1993; 7:22M+2vDiPm4ee9Kol4pYpnQb5Fy6JYGBei9qo4sD0bEiJFbZzwpwhKopaMaog+cCW8yJsRufIG4YqPT96AbTKN8KYfMFbRFnEP3kBVsRhruCUu/Dw8A/8pvsSqPbUYrp6pAnQOnVyXW7FX5/rzrgsefn6aNVK0UPzIkC4U1TgraY07Mnmbx89VPSyx4Zwj9YkC7pY6hPrSvt6sZmxU7EgUKx7HT9YxUAejcctn2NiQIX+6JG5NCT1a2ePBR59ip67WxcB2SmiWOVApYEfGDG0/vq1bd2+sUQP6RQl9NAVJlUAWvkY/XV5xP04oODgYW77/q9Ae9UktsAH/vwl9cKug==; 20:BRP5XSNcLXLk8ZBaKGsKwOYB4+vMBqOusR1DRRZdS0+RUTp72NprBeqbGEFLRQckVk8fmvLNDKQRlb4mYGBMxUougAVbhJ50b1xns3MzGd6R5jJHpC3UfRoCTbYDsGCmzY6ihKywQ6WviOfEUY0d3YaTkKaXH0bUB6MlHCFGPtc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2017 13:58:38.2750 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1993 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.0.136 Subject: [Qemu-devel] [PATCH v3 13/13] serial: chardev hotswap support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: pbonzini@redhat.com, Anton Nefedov <anton.nefedov@virtuozzo.com>, "Michael S . Tsirkin" <mst@redhat.com>, den@virtuozzo.com, marcandre.lureau@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/hw/char/serial.c b/hw/char/serial.c index 1e6bdeb..ed01637 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -891,9 +891,37 @@ static void serial_reset(void *opaque) s->msr &= ~UART_MSR_ANY_DELTA; } +static int serial_be_change(void *opaque) +{ + SerialState *s = opaque; + + qemu_chr_fe_set_handlers(&s->chr, serial_can_receive1, serial_receive1, + serial_event, serial_be_change, s, NULL, true); + + serial_update_parameters(s); + + qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_SET_BREAK, + &s->last_break_enable); + + s->poll_msl = (s->ier & UART_IER_MSI) ? 1 : 0; + serial_update_msl(s); + + if (s->poll_msl >= 0 && !(s->mcr & UART_MCR_LOOP)) { + serial_update_tiocm(s); + } + + if (s->watch_tag > 0) { + g_source_remove(s->watch_tag); + s->watch_tag = qemu_chr_fe_add_watch(&s->chr, G_IO_OUT | G_IO_HUP, + serial_watch_cb, s); + } + + return 0; +} + 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; } @@ -904,7 +932,7 @@ void serial_realize_core(SerialState *s, Error **errp) qemu_register_reset(serial_reset, s); qemu_chr_fe_set_handlers(&s->chr, serial_can_receive1, serial_receive1, - serial_event, NULL, s, NULL, true); + serial_event, serial_be_change, s, NULL, true); fifo8_create(&s->recv_fifo, UART_FIFO_LENGTH); fifo8_create(&s->xmit_fifo, UART_FIFO_LENGTH); serial_reset(s);