From patchwork Wed Jul 5 14:01:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9826571 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 6C6B460317 for ; Wed, 5 Jul 2017 14:04:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50F90200F5 for ; Wed, 5 Jul 2017 14:04:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 456D628506; Wed, 5 Jul 2017 14:04:04 +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 EF30F200F5 for ; Wed, 5 Jul 2017 14:04:01 +0000 (UTC) Received: from localhost ([::1]:46386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSkuN-0004k4-1N for patchwork-qemu-devel@patchwork.kernel.org; Wed, 05 Jul 2017 10:03:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSksu-0004hx-81 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSkss-0007js-Ex for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:28 -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 1dSkss-0007gG-5S for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:26 -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=rHOYQfMws85/v/TKFWwrtCxzwpx900c6vY6eQMYDauo=; b=V2r48i8qv8Za2SEVsK9xKB7HlRhRhPA9uurMshxR7mmcjO/N/sPE4W+g+iToXd7dZYSxg3O0DQbpaZJhlQghxIPzFvtyeBmoNncHnGhKPVXLIf7GgZmPlknqR78tAuDK89j7s/jhbCALAMvas4bNK8RuX3jIPPK2J/YQ9pblCxY= 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:21 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 17:01:54 +0300 Message-Id: <1499263324-15184-4-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: 6ff035e2-d055-4d06-c25a-08d4c3ae756c 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:RWIhF+/bySloffNvr3VJac1sy2JLDuvouQkmb/DRfWHhnSZ9IZHHL3kG6s/L1/6WhPZ1bfllDOjQn1KN8XTB3tVwqmQ/c6LL6EulRwZcNn0IFrK5+fkGsGYHQC/mh3xwWZgqqUcxYBlJ+qmsdO9S6zp1nCxxd5DjLem89BIKVNci+Kpdg2gVjWv3gdHIjjNKevABgiyann8siE2i5lj5JutiqP7C/hSMWoNXpF0jBr/LJe1dGK/pYZ741aKtXKcoTUjt6vDKCyEaoQj83gbQ39gElBRVjtXUqf/peHIFFIouZGin3Q9Tzq/4nFSBa3ylLnbGaWHEReYHBsgY6KlATIEC1zsRDJDVcumWFbml+hXmiv9FBJL1YDcfQ7EaQEgY0dtQdRnFufEYrk9bQ6J4eAP87pSvdA8MeGwGVF4V+blTp+sDCReNU1Shm2QgUU5n/8O7uBVLuJFAPDU7Lb4+3Fh/1SItwAIMOgBrAyRZRGIPniV6a8ezZb6Ct38VPIHavICgkgM+oL2mVUaWnTzBahBhpDu6Q1KioKGz0iDKFFtSelPFnB495FlfiViyA0qL5lfu7tBHjFm/vNlTt3hrk9sm2y4WwRtGr0ZvgUve69pGKExUHBp5KgTspAxv52njANiih+kvI3C1lQP44UvrHbiecYl+4CEtn51nACvZZ6IbxPqPc/0jE8OhvRJpatiW6SMeidceyaq2L1t5dMW9Y+ncpVTNOkhEyitHrz3isnMnU30W9uOx7psOsJBVJ9BV X-MS-TrafficTypeDiagnostic: HE1PR0801MB1996: X-Micro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tqBmpfBADCg3wnvfMWsx0Umkopv/gU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863)(133145235818549)(236129657087228)(148574349560750); 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:SIiJ3Hn7KYaewAvMFAnHomuj+hOdFfy8GweMU78U?= =?us-ascii?Q?j3lmaPp9xYBz9zxue7nW9lHNfBs0bn0mQmRDEqP+yPLnCdYPcCKXiyHyFj0l?= =?us-ascii?Q?sgO4An4XmV2gwN/O5wiP6EGrHjwGq1aLLjBdxFggXm2+0eeQiL8IMSASvWu/?= =?us-ascii?Q?CLY3DAahN3T/BLM8ld4n4iE3HdZP6PugSbHStLS9DS0z6DmYUixzLl1W00vW?= =?us-ascii?Q?jxwnuuQ77riT9MjJxkAnm0I5inEH4uc7oU/z2AR8rqPZsLJqCkLYCCjhozlt?= =?us-ascii?Q?CloJPsYw9FExE84Cl2Z5w81ctQ8XVgzIsN2RuLsCOtTdyfvgj4J4xOPi690D?= =?us-ascii?Q?1uG5aJ5+73RvDrLiuZYg5j/li+LQ9p1PRKMvNdEKv91Ip02n2OT3KTRkiQxp?= =?us-ascii?Q?gq6aUtlwXrcovtgMFnFTJbijc1O3oaTWQELEiNVRKsFBzWLcWXiI/HP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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:D3DyQ/fAx5BMdy4EOKm/2/KkeqrGC22oqd0jwYp?= =?us-ascii?Q?yAuV7Y9Wu6lc4kkvrChbBWuBc+0djKTfpzesY6ACBe2ihtBZDbCoFUY0VRL+?= =?us-ascii?Q?y1518DctXmiHiocaM8sraLtim2oDcUYAmwz57w+XC11GRD+VTbU8ieZ7KJKk?= =?us-ascii?Q?v7FoeY/RpBf2lLfM2jl07jxPKW8/mr7tnlzJZRoZ+x16fcXx9K+xeLSa36u+?= =?us-ascii?Q?bbg3jX6X2E1Efs+otAJd59Zp1C9S30tsiKsIKmf5+xyRclY3L1c0s0453rBj?= =?us-ascii?Q?8F7p4nrZwmyPYUpA5jbe1Y7aZAE66+LAr3NQvSLu/ebHzc2teBFCYXI4pXya?= =?us-ascii?Q?eA/SjE9ArXbeb2F3RByzmv+GOJzpnYzku52vQ9wHP0wNvlfW/kQwai1YoOa0?= =?us-ascii?Q?0LJoqfhL/RdyAC9EiSJG5CveIi8Ds2T0Fnggiui41sc44JKuLE0yg+6t1OX1?= =?us-ascii?Q?N0MIEhwBtqmb8X9exkp5WK1MPVlkiWDekc1YeHGWs8iZ92GTtnlCLoQZGmdU?= =?us-ascii?Q?0qcIwZHr49l0+zaPyoe/dKnkvPyvc+ip4+wqSDpytfLTzKLwLqZccOgt6bSO?= =?us-ascii?Q?kOrukvyfWsbRuxHmFjGqRmHDvQr5YHcvVnf3zEkOZhzfcX53d+Wc7VcFtvA+?= =?us-ascii?Q?OUjADVYOsRHM3GRJaTN7gpT4zymCzEHqpoaMOSatJcs4kNrIPh7i0wYK40x8?= =?us-ascii?Q?dAmlotktvU+lX2RzLl8uyXY8AAW2fhIkh1WIOZ3KmMzIjZA17SKyR7MrCLVP?= =?us-ascii?Q?qios3iRblwwKIlk2OzeRYbkwJmvHCMWVOH2uUOfhtYZBhm0C4tSbL6p9+3oE?= =?us-ascii?Q?4TSdWokli+BrOyyp4NYd9TZd1Xg0zd1ccHmw9MRbe+2OZZdxl6FQp+m9ehdn?= =?us-ascii?Q?AUz6fTPniVmPKbxPWYcFdh0aPFbeLbHwPCxb+1XlNmztNmdQXAEHVGRfg1h+?= =?us-ascii?Q?kqzckeEh3harDX0sY47eXkCI0Jq77G2o81qkkeiQTiCdJl7i8dP9r8nZ7HYU?= =?us-ascii?Q?5bkj7yssGIIL4ffr1XSl8tCRhTu1tvJ3fGrO2/bWEDKH1+Fh+YPumJr2RPfC?= =?us-ascii?Q?Quki9uiNzoFnSnS21O2qki1BAwECh?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1996; 6:IJASlr0Lw5topj1wt63no8FkjTc4D98rh+RjEENF?= =?us-ascii?Q?8JG8uJwePQBY8etQrrws8H6cQaTm8faXUsz/7eQe5jMUchkKp1NBL5MF78VH?= =?us-ascii?Q?47TjWiWorZ6fkt1VN4y6yxaCGvQOGEAhtGh9zPmEzSnXM44yNVYX++CFSRqk?= =?us-ascii?Q?e9BsDSftoCjAAcvVzmtnWx+hbEUrUVOceHbNhMg4MWKRcnYVw9sEK55Q9el8?= =?us-ascii?Q?TEmvUP6h8vh6YOd1yp2rlGzNC3WfWkqwaPO/nJQFyojzmwejc0af96gDOMfF?= =?us-ascii?Q?t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YTd9lx48Lad8JSwWs/2e4L8mI1GJQH58Fldkp213NyVOXZ/cLjpJqntHF1fgS5esAFMWyg1/FYe4dihhp3dqh9tYnkNfoP8f5qGXA2KzW0m69f7q+ef8ZuZiBnLJ0IVh+80zgjqfc+QgRM6nor2OC5Y05UAAbkIENCaueVrpsxqmiY+cWnEQPv1MUxq64Tz1riI7mmcPpQ/kEHFwHnVbEJXAr2Q9oqiiv74b1c813/QxrW5sXozO9LhnWiIfj8r2rLBCXEhZYlzaMoW2xswIEqApI0= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1996; 20:9rNp27p0ZhgHiS1Q86HugtSBchaKH/LWBq5YG35PKA26OB56IN/pM1P8L7KnXycVhgLIBainXGe+VyHkX/c9c7gRLX8FV0qvpOUBvBtsroahlgFhw0ZbowggwaYdGKR+WuT0ibw3+H/NjVufhnJDPfvgGO3Wemks/KErm+1d83E= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2017 14:02:21.6151 (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 03/13] char: chardevice hotswap 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 This patch adds a possibility to change a char device without a frontend removal. 1. Ideally, it would have to happen transparently to a frontend, i.e. frontend would continue its regular operation. However, backends are not stateless and are set up by the frontends via qemu_chr_fe_<> functions, and it's not (generally) possible to replay that setup entirely in a backend code, as different chardevs respond to the setup calls differently, so do frontends work differently basing on those setup responses. Moreover, some frontend can generally get and save the backend pointer (qemu_chr_fe_get_driver()), and it will become invalid after backend change. So, a frontend which would like to support chardev hotswap has to register a "backend change" handler, and redo its backend setup there. 2. Write path can be used by multiple threads and thus protected with chr_write_lock. So hotswap also has to be protected so write functions won't access a backend being replaced. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/chardev/char-fe.h | 17 ++++++++++ include/chardev/char.h | 9 +++++ chardev/char-fe.c | 33 +++++++++++++----- chardev/char.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++ qapi-schema.json | 40 ++++++++++++++++++++++ 5 files changed, 176 insertions(+), 9 deletions(-) diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h index 9f38060..0314870 100644 --- a/include/chardev/char-fe.h +++ b/include/chardev/char-fe.h @@ -10,6 +10,12 @@ typedef int BackendChangeHandler(void *opaque); * Chardev */ struct CharBackend { Chardev *chr; + /* chr_lock is used to ensure thread-safety of operations with + * the associated Chardev. + * There is no guarantee otherwise, generally, that *chr won't become + * invalid. + */ + QemuMutex chr_lock; IOEventHandler *chr_event; IOCanReadHandler *chr_can_read; IOReadHandler *chr_read; @@ -42,6 +48,17 @@ bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error **errp); void qemu_chr_fe_deinit(CharBackend *b, bool del); /** + * @qemu_chr_fe_connect: + * + * Connects the already initialized front end with a given Chardev. + * Call qemu_chr_fe_deinit() to remove the association and + * release the driver. + * + * Returns: false on error. + */ +bool qemu_chr_fe_connect(CharBackend *b, Chardev *s, Error **errp); + +/** * @qemu_chr_fe_get_driver: * * Returns the driver associated with a CharBackend or NULL if no diff --git a/include/chardev/char.h b/include/chardev/char.h index 8a9ade4..22fd734 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -93,6 +93,15 @@ void qemu_chr_parse_common(QemuOpts *opts, ChardevCommon *backend); Chardev *qemu_chr_new(const char *label, const char *filename); /** + * @qemu_chr_change: + * + * Change an existing character backend + * + * @opts the new backend options + */ +void qemu_chr_change(QemuOpts *opts, Error **errp); + +/** * @qemu_chr_cleanup: * * Delete all chardevs (when leaving qemu) diff --git a/chardev/char-fe.c b/chardev/char-fe.c index 7054863..86a878b 100644 --- a/chardev/char-fe.c +++ b/chardev/char-fe.c @@ -33,24 +33,28 @@ int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len) { - Chardev *s = be->chr; + int ret = 0; - if (!s) { - return 0; + qemu_mutex_lock(&be->chr_lock); + if (be->chr) { + ret = qemu_chr_write(be->chr, buf, len, false); } + qemu_mutex_unlock(&be->chr_lock); - return qemu_chr_write(s, buf, len, false); + return ret; } int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len) { - Chardev *s = be->chr; + int ret = 0; - if (!s) { - return 0; + qemu_mutex_lock(&be->chr_lock); + if (be->chr) { + ret = qemu_chr_write(be->chr, buf, len, true); } + qemu_mutex_unlock(&be->chr_lock); - return qemu_chr_write(s, buf, len, true); + return ret; } int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len) @@ -182,7 +186,7 @@ Chardev *qemu_chr_fe_get_driver(CharBackend *be) return be->chr; } -bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error **errp) +bool qemu_chr_fe_connect(CharBackend *b, Chardev *s, Error **errp) { int tag = 0; @@ -211,6 +215,16 @@ unavailable: return false; } +bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error **errp) +{ + if (!qemu_chr_fe_connect(b, s, errp)) { + return false; + } + + qemu_mutex_init(&b->chr_lock); + return true; +} + void qemu_chr_fe_deinit(CharBackend *b, bool del) { assert(b); @@ -228,6 +242,7 @@ void qemu_chr_fe_deinit(CharBackend *b, bool del) object_unparent(OBJECT(b->chr)); } b->chr = NULL; + qemu_mutex_destroy(&b->chr_lock); } } diff --git a/chardev/char.c b/chardev/char.c index 839eff6..a7b342f 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -951,6 +951,92 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend, return ret; } +ChardevReturn *qmp_chardev_change(const char *id, ChardevBackend *backend, + Error **errp) +{ + CharBackend *be; + const ChardevClass *cc; + Chardev *chr, *chr_new; + bool closed_sent = false; + ChardevReturn *ret; + + chr = qemu_chr_find(id); + if (!chr) { + error_setg(errp, "Chardev '%s' does not exist", id); + return NULL; + } + + if (CHARDEV_IS_MUX(chr)) { + error_setg(errp, "Mux device hotswap not supported yet"); + return NULL; + } + + if (qemu_chr_replay(chr)) { + error_setg(errp, + "Chardev '%s' cannot be changed in record/replay mode", id); + return NULL; + } + + be = chr->be; + if (!be) { + /* easy case */ + object_unparent(OBJECT(chr)); + return qmp_chardev_add(id, backend, errp); + } + + if (!be->chr_be_change) { + error_setg(errp, "Chardev user does not support chardev hotswap"); + return NULL; + } + + cc = char_get_class(ChardevBackendKind_lookup[backend->type], errp); + if (!cc) { + return NULL; + } + + chr_new = qemu_chardev_new(NULL, object_class_get_name(OBJECT_CLASS(cc)), + backend, errp); + if (!chr_new) { + return NULL; + } + chr_new->label = g_strdup(id); + + if (chr->be_open && !chr_new->be_open) { + qemu_chr_be_event(chr, CHR_EVENT_CLOSED); + closed_sent = true; + } + + qemu_mutex_lock(&be->chr_lock); + chr->be = NULL; + qemu_chr_fe_connect(be, chr_new, &error_abort); + + if (be->chr_be_change(be->opaque) < 0) { + error_setg(errp, "Chardev '%s' change failed", chr_new->label); + chr_new->be = NULL; + qemu_chr_fe_connect(be, chr, &error_abort); + qemu_mutex_unlock(&be->chr_lock); + if (closed_sent) { + qemu_chr_be_event(chr, CHR_EVENT_OPENED); + } + object_unref(OBJECT(chr_new)); + return NULL; + } + qemu_mutex_unlock(&be->chr_lock); + + object_unparent(OBJECT(chr)); + object_property_add_child(get_chardevs_root(), chr_new->label, + OBJECT(chr_new), &error_abort); + object_unref(OBJECT(chr_new)); + + ret = g_new0(ChardevReturn, 1); + if (CHARDEV_IS_PTY(chr_new)) { + ret->pty = g_strdup(chr_new->filename + 4); + ret->has_pty = true; + } + + return ret; +} + void qmp_chardev_remove(const char *id, Error **errp) { Chardev *chr; diff --git a/qapi-schema.json b/qapi-schema.json index 37c4b95..0090fbf 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -5098,6 +5098,46 @@ 'returns': 'ChardevReturn' } ## +# @chardev-change: +# +# Change a character device backend +# +# @id: the chardev's ID, must exist +# @backend: new backend type and parameters +# +# Returns: ChardevReturn. +# +# Since: 2.10 +# +# Example: +# +# -> { "execute" : "chardev-change", +# "arguments" : { "id" : "baz", +# "backend" : { "type" : "pty", "data" : {} } } } +# <- { "return": { "pty" : "/dev/pty/42" } } +# +# -> {"execute" : "chardev-change", +# "arguments" : { +# "id" : "charchannel2", +# "backend" : { +# "type" : "socket", +# "data" : { +# "addr" : { +# "type" : "unix" , +# "data" : { +# "path" : "/tmp/charchannel2.socket" +# } +# }, +# "server" : true, +# "wait" : false }}}} +# <- {"return": {}} +# +## +{ 'command': 'chardev-change', 'data': {'id' : 'str', + 'backend' : 'ChardevBackend' }, + 'returns': 'ChardevReturn' } + +## # @chardev-remove: # # Remove a character device backend