From patchwork Thu Jul 6 12:08:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9828089 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 DA529602BD for ; Thu, 6 Jul 2017 12:11:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA36D28648 for ; Thu, 6 Jul 2017 12:11:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEB6428655; Thu, 6 Jul 2017 12:11:19 +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 1834928648 for ; Thu, 6 Jul 2017 12:11:19 +0000 (UTC) Received: from localhost ([::1]:51151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT5cs-0005O1-B5 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Jul 2017 08:11:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT5bV-0005LN-Dg for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:09:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dT5bR-0004fa-BL for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:09:53 -0400 Received: from mail-db5eur01on0092.outbound.protection.outlook.com ([104.47.2.92]:45027 helo=EUR01-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 1dT5bQ-0004fE-Sl for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:09:49 -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=zw41KwYJffzmjuRWeJbLI9T7WrhZiUyHNjbwgBnQJWQ=; b=d4W4NHHe8zTxhAS6soryD2icyk3lBiVDgcYqMC/dOVcdPG7DHzv5IEQaSUufs+KdV2CSoMbDDnMCG8FBvcNyJ7mrxxSaN5iyy/lxIELUIjEZGh8yq+80P3VA97vr1h961jxEKaZffwhwxpP5HqkgLmk+87N7N8PFsJ6eTKNslec= 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 AM5PR0801MB1985.eurprd08.prod.outlook.com (2603:10a6:203:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.13; Thu, 6 Jul 2017 12:09:41 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Thu, 6 Jul 2017 15:08:50 +0300 Message-Id: <1499342940-56739-4-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499342940-56739-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1499342940-56739-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HK2PR02CA0118.apcprd02.prod.outlook.com (2a01:111:e400:79aa::44) To AM5PR0801MB1985.eurprd08.prod.outlook.com (2603:10a6:203:4b::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e869a35-ee9e-4c80-8981-08d4c467e4c8 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:AM5PR0801MB1985; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 3:y6xwjz0ZSSP776haOVYU7JjGF9vnldzMe6ijo83zFJNJfqjWKDl+kWD6TXg3vGKTwhb3gdYcyZzEt6l74pOJzD2F8rZbKpkDhlxWDV4geUoa+7UgO/A5+F83osSSbZstf18k8Xl3sdhBfVpnGHqOcq3S0jsLBENK8YMJxooLcb7MUKqIIN1Es7P5eh3f8se+u5iL3KJnjz7bppYe60Dz6MxbUdHdouzR0zPPSOPMgJIe1kqifIe4VJNDLILMcpf5EMNVs/CFUacUGkiBxSbBIgp6sfGKg7rTZTvtMPBe0L+VAvXhFcczNJxK0DWdHIlfikelKYoVRjtGe97AkOB2qbA9VvPkcEdC74OhJr035OGIEbh2Axi2mslWSl6gIlXKjtbNbhI9ty7nn+3EUcivHuQk4hkO39+8oM359fRVH8QRE+ufwwkBDhkMI3QSTpvePeeI0CS2MvafQqxThj7e9Lznqb1FaGFOIk48/mn+1MVF6XM4vdcL1Ye8EeTisSH3KHdNhMArvKiExOfEENXEUdNtgaTsfXECZHUk7kBBCzuDvQs6t/D0SWgCHvnWI2q4s31gjBiUEKz9XSjEJ80PWclcW0pYs4pEOkb3JD4PjZjXHTGY+zwk/DKnl9xvzIcNr3eAuGuqrKHRNoV9aDVFwwYdr9vh0tkdJnWE6V92Fut4RYiX38QTT1e0mgCUOOusvSoR/Pew+2WqveVFU9DEd5yfa6Z3HSA+gZeQAQamgJDdvLFFuvnhihpXATizQ/2g X-MS-TrafficTypeDiagnostic: AM5PR0801MB1985: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 25:1sYTv0RbjddpcyEZD+nUTurNvCc2VTYABgqcdGiIW16e0gpRAmGb7wXzCcPpAA3wogcXXbIwqoPFlcS8S7hDa2V1/nD8KcFzCGA8mTEuD93HsKqHGchheOzE1KRQbv/wQF40brHJVcw9LBhLx+a/x5Ruas4bUjGWyzkigYypsZydiOW61uqrgtbdYVFdRq6drio7yGEWTGDImnXPiYCB0PXu1e3iBvPbqByncTT0BX024DfZB0cMR1dCZIDiRVEkdC0Bh0kOwSEJhaADOl0WgFSVlMPRyIp3/2NE3XGQknJYGiarceHRWTnS40ml8aA1jpgC9jb+baXpuxLkVuqZtbayESC7jNy36vnsWomKfhSq5y0wL652SKku1i65dj2KNrHy2x9JLSj8p2eplZLMcL74oGefUfuG8Sm1EYtODKnV0U6rQ84ssQ/chIjbOq7vpz6BBmjzozQY6SddfaL4cBCCeuovY0XvVGs8ObEk3QAgkZWUII1hIE/U2QJvIkXD5a5dSHyBPQHnARBQg2Di9oJ+JenpKWr+G40b0HQGFkkdAf8j9uGnGDlclXt7LRvFEtEkksHHlTlpAW5MIUnZ1T8KFuH4YciManWdtNyG4RsHNhk+8TUb4WljzAsRFA4RDo8lx8X0YrOWzSO2qCoA1OR64MIb+93Tb7PWjTdqwt6xJAC0qUk74XccZzPIfw4PrB4tqCUt4heaX2va5Te56mCo2sJKG6gPA66eqBoqMcnolVVhX3LoG82wsrBQ5MUkhtURgSEm1PjOJBu3IVSf05SVmAKTBGIQqcE5jneA/AQ78UlLYnz91XrFEhOGX2XQIJWHV8WzE52pv3rQZz+Z/oCwUhs6fSLmVGhvsBD86zAqZ32r2mfC9gvLyuIz66U5FmGIg7ncvqRAWBMmXtgx7JV1mi9vVHte/swjL+/NNZw= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 31:HTdOB7celhb2GLWNYrd3ulizgdmmMvbq2qXQ2F3XUafOxzi4ytiiHOe9eOAHC38aeoxRy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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)(2017060910047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0801MB1985; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0801MB1985; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1985; 4:Yuuh9lW0D2C3Y/FX+rh8o3VvssKUcQMQ0yKsUO/X?= =?us-ascii?Q?L5ZnPZlyPzq2XfrwGCZgHXzcxlIVy0zxBoIPyNBy8ynu1ptvlyLURiciwjkV?= =?us-ascii?Q?V+2ICotOj0LtQSmOU4qudqemO2VaeqfI0sFgZY9dshcS1/u1khzCQcOKe+FM?= =?us-ascii?Q?EkJLik0L8QIYcyeDy3z+tvsi5wD2qotRdJ6J3MsUA7Ocaxnp/0C6ov51BDTe?= =?us-ascii?Q?abERy511X8WEVbNRsMSjTaisr57RzoXJmvDXX4hVN0yW0ZRt/32XXb9/vobo?= =?us-ascii?Q?u8e1dL2e6UFZ8DegvgGVVNjgBGnOZmaA5xyvT5M7t5Zn4tL2PQh3LeaFlAhR?= =?us-ascii?Q?SbTohc9xPDGp78tMMBHS93TFfWzUgCgghmR4fMeIedFKC9Qtlqqazu00dRym?= =?us-ascii?Q?MjsurWI/+QRQenkCUw2GVclGiDyLwgfvKKEyzQKk6uR06F2d45baS5NZ2AOx?= =?us-ascii?Q?IoMW8/Q1ak0EmisxnbF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03607C04F0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39400400002)(39840400002)(39410400002)(81166006)(8676002)(36756003)(2351001)(50226002)(25786009)(86362001)(50466002)(305945005)(478600001)(48376002)(5660300001)(189998001)(6116002)(5003940100001)(3846002)(7736002)(4326008)(107886003)(38730400002)(66066001)(110136004)(47776003)(2950100002)(53936002)(6666003)(76176999)(6506006)(6512007)(2361001)(6916009)(33646002)(50986999)(42186005)(6486002)(2906002)(53416004); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0801MB1985; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1985; 23:8YwkAoN6RsqmjOM6yYukzKbbUEWndq1u9vMvpPa?= =?us-ascii?Q?KyYAjoyfmmfzVHi2UfJwVAQFi+DBhQGLVlFjjYVn7XljZfOHVnnky35y9avE?= =?us-ascii?Q?fOjDYs052lVMjbignVOFEPWZfuYAqIqniPaDuMcvNpc4q/dyPi6rkpNapSYF?= =?us-ascii?Q?prFg7QZQu3G46kqJkPUt9X4UEcphDVpjC8Odj5UF2V9uTKwaMNYBwTCwewYX?= =?us-ascii?Q?8Mhhz8pLGnH5tl1RYLVKRaO68ZziacOtyh1QMG+cBUGPi8/tqIbsjXLXlWxS?= =?us-ascii?Q?p6MCzi41N7q4N48Zs1Ry7d6l6z/7+qm8bheRMLojTxp2boDpY9rfZ7GIusxm?= =?us-ascii?Q?5xabp0qhOrBS7iq+mh65n9Nvf9sBX3lkw6Qr2GBfjNJwsWFPRL7nAwIyHvWB?= =?us-ascii?Q?ds406k3vQATNc3kc6OBs4UXwYp2RXUYXNDYbc0vL5gQc49Nbv/BH7NsI2huS?= =?us-ascii?Q?BdEjI3tUewxTTlTaV28SAsWbaz/iz4Sc009gq5ghuKsmwWEoJBFJhtk+OxuX?= =?us-ascii?Q?CSLtRAWXcP2tD0B5CGRRy17WSSE2mpulHfl9OHweXamt6euQR8PeCk1RiaAM?= =?us-ascii?Q?7/IeYoWXB0wnuscLqnzEKe5cWTdPtENpYQOxnggsxCjM5UuOiNffuGhZb2KA?= =?us-ascii?Q?6LOMQrZ6R+9kfEmbl7utPC2ML7xGWdQrjmiMSy1Gc3+Te01IG2jKASK8Xibv?= =?us-ascii?Q?UxoGRi9rY8LdquQ2Xeu86qNaOUYuEit3R2eZBSB4Ys0YQcgkSXgjcDYn8wdk?= =?us-ascii?Q?YoekOGLM42LmnwNYSo9yRR42DzZMqFr+q7jQwfBE/dbEV3B0rZmMpUrFkM2u?= =?us-ascii?Q?wBWg3ZCf1DyKn/D584BNW67dJGjuifQBgmW7ThEfz2NKueKy7HctMJjBeiGC?= =?us-ascii?Q?rQxNcgZqmHzT/wZqx3clwg/2Tm3Cd20p2p73dkITzflWAt63te+pMWxhpTW7?= =?us-ascii?Q?ML/BUIBqoPsWDtaCp7CB/DbZnnnzL+ILOQMK1Ay7Ir781mcokivEAxygm2N4?= =?us-ascii?Q?rw3lN84x4LhDDKJQj+QqXocFdP5v3kw76EWS8RWOMUYJHn4br7gGFtBHAUib?= =?us-ascii?Q?nIU+T86EyYFYg3OJFbgEvqhr0vL3V?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1985; 6:tUf9VROP9BX0Nt6yaJ+1s0Sj20+fdK4CtA386TJz?= =?us-ascii?Q?uB2vgGrOfx8o1SmtsyzTgLofzvLxiVQ+ac6wW0op3WXYVO5X0n+dPvFNp3ZO?= =?us-ascii?Q?/0cuiMIVn7vUweCbxnj7+dCKdfU+a95NCtccM4QJkJoQyTMtP4BVbcUlTrTT?= =?us-ascii?Q?mzGvuK2SDw06Apu4FEBdHQXu3kSmt58US8dpvfg4fXtXxHAPTryu0bAMISgV?= =?us-ascii?Q?A8YFgIFniH7OE95Xi6oz0WkxP2L6VqMzn40PyfCmLNN0X5WMwhDflKE8TXJF?= =?us-ascii?Q?/nZ1Q2Nj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ziV2BbU2K77ZulVTFaaHyPoHUYv00/3GYi+XwmJa7osbqM9JXeTWeQPmB5BJKq7ZZ3esM8CoXbQIRp0atbNlYT+iFcuUUtyQVJQZ4J90MoE+vT5cUvbjW9e0qR8KI30ohGvEa+FyFCdsXHglh0zoY8Vt1VMKAhYfJcPcE6bMubNZI/wfzTfr7qPPoLU07Yj531rtJ0T2+ipjnf5gBuSaniuwYxuJ7PHnuQEWveJWZcOeFnjDqzbMG0HpHbpG7+F3kQTX3cvgYMQuF+g9pFBSQ4mGl2LPRUI6sqh+qWQiok58= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 20:+hlCdULsPHcppmzJsPOofyZ0B58ieyWLXd4v5R42PCgiYVlhza1AcdgquD02x/LD8+upHzpsHtFzILOHLDF7APNN0z22DnLPFNdPtLV96VjBhbRr0mAGNLl+SG3OevH/P/pFESTDEV02cG7VzF0wgGUMlUyd0/pKUsbFP9hORn0= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2017 12:09:41.6355 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1985 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.92 Subject: [Qemu-devel] [PATCH v6 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. 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. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Marc-André Lureau --- include/chardev/char.h | 9 ++++++ chardev/char.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ qapi-schema.json | 40 ++++++++++++++++++++++++ 3 files changed, 132 insertions(+) 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.c b/chardev/char.c index 839eff6..d6b9d89 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -951,6 +951,89 @@ 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; + } + + chr->be = NULL; + qemu_chr_fe_init(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_init(be, chr, &error_abort); + if (closed_sent) { + qemu_chr_be_event(chr, CHR_EVENT_OPENED); + } + object_unref(OBJECT(chr_new)); + return NULL; + } + + 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