From patchwork Thu Jul 6 12:08:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9828099 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 C1870602BD for ; Thu, 6 Jul 2017 12:13:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B267426BE9 for ; Thu, 6 Jul 2017 12:13:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6B3A2865F; Thu, 6 Jul 2017 12:13:24 +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 CAFF028657 for ; Thu, 6 Jul 2017 12:13:23 +0000 (UTC) Received: from localhost ([::1]:51163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT5es-00078S-Uu for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Jul 2017 08:13:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT5bI-0005Fv-Iw for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:09:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dT5bE-0004ci-Iy for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:09:40 -0400 Received: from mail-db5eur01on0099.outbound.protection.outlook.com ([104.47.2.99]:23040 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 1dT5bE-0004cM-3U for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:09:36 -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=h5ZETzwQCTZxfCiVkYTLSPXAuOsNqkIFE1aUwpXJrJ4=; b=OnTwvbsPfsqSjcNu+O4Xaeq9wMCn6E0gbmhaGSn4TxnVUASNgLQDKZhG0Bho03A+PWJ0WkwcfygoB1TD1hMQ+7OU6jXv9JsOUlUQP+miOdlJCGiyFiK4Xu897XmnvvD3PU4MwqqwBBHIt3I1xqcKzEY5jAx6gzHz5EosVLNopb0= 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:28 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Thu, 6 Jul 2017 15:08:48 +0300 Message-Id: <1499342940-56739-2-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: 0e02d6d4-5df4-4891-dfed-08d4c467dd27 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:4gpwi0SVlARrfM5yonep0pSZ4CIKHlDpNXPpGTcQUMTtWbEKx0rHhDXLTqry5t84StH0h4qTJRITrn16BWGyxBaKU9qGPVkS+69XaAWNjO2jucZIavtk7jMY4rsvIrEtU2mQSUrR2bQRU9aQSPRuwzr5Hgxh+ksEvJoLIBnU9ILdUQvaUN7LPd0AA9Lna3IPstSIvKfVHufyL+9KaNcW/jkp9qmX7gEB0h9Np6WoyOfcLXT6QTL5O5llYmEnnVWH9QdFUanEgukcZ4dtFV4Lq7WtRE3fQugbfkLr8j+d8ZvsDcegRknBjJ0ewGeZuBclxRXE1jJLu371BrliRfqJ8zpreS9dHygOMcqfdiF3pYn3Giy0aRRGP5wWEof/WD8gn92po+7wBOtDEXRpWj3TBjpk5duFAK6ZvGepf8wRR4u6mBHco2gIhD6i7IWm+plfd7U4BSULEXMsWV+fstdQn9eAdf5cwIo2E3wPaGC8V2EqHXnGdKMufhyPW8MGrSkO1nWWhu+lgAlmmYImKYPkUxE8En0mNWPj8NPCcfq0tLif/UlVPEkBjrspKBTQ0GgpiCLR86XasC8MY7EYIAkWAwTpb86NWwTEvMjI/HI95a247VdmqDVVP+46UtWRHVvA+cvjaTzi/oXxGh3iIdcl2o8DdnYetX365Xtk5oxC2PZkDY486fQZDFakXYxtTkn4XKJjLzdgVbx9k/Rs+oDakSVIHtqXvVlAKVWmHrdq7uD4p+22LQNsVpvYn2PHcB+b X-MS-TrafficType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Yum8CuZXHtWPSSK1rReVqLop7HKk5tL8ONMQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228); 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:zch37OtrDXWOKm6dnKlljT1fZbcOdokaCbE8C3KN?= =?us-ascii?Q?JZbRbhCAgfhcBiuyql9uGjr0erlG8kldnuaLmE8w6U/YI7o46HwR23xKoqwP?= =?us-ascii?Q?6Q0FgiZPFTjcx6WUV59rYqfltDdoP3zkEBf7t21aDZm7EWarSoMEkRWfdwFY?= =?us-ascii?Q?Vl4SMx2Pu0yXzbT/IP3FeJEGP2p00jJ4noPOSHR2XjbkdljJjLp5sSYG2kkA?= =?us-ascii?Q?ecXk62UQJz14eEHlZkmVoiK7U8D+StBJCf/2ygifIWDYWZQV0++NLK2Kc+/5?= =?us-ascii?Q?59ukv7jHS3E9IoPUoCCkWlof8oKkdQQDWFu5x2DrBest4gGVjrGwEkQqLMWe?= =?us-ascii?Q?Z0qN/j1aoukbjyxwMdjfvFIdc9RpWfy/mQUMrlbRvLcPkfQuK7RHCX6s1yUZ?= =?us-ascii?Q?+9E0X6VmMro9UnIaFEj4eK8Tocl49Q1OMlZP8wDyHhr8DxiQ76dCwfSlvI4U?= =?us-ascii?Q?5rY8dczvhC8cO0ZYH7v2cCtOFQKx1A5cjWEBCwAK8KDpSmnVGMFUXoM84ua/?= =?us-ascii?Q?lbcX6uBgE6leHrRp7zRAPjfUxS9NXvhEccAu0WAwmgm3PJO94swOceUe3Ypp?= =?us-ascii?Q?+ptliE+0gFdMpr5CLda8CzbhT6ozAbvfv5UGmBb7WNOBbEMxgSKmJNyuwLyo?= =?us-ascii?Q?2+UiBm/jqyh8OP4SXgbqiXofVsk+1ZYjymBWD+a5ixaan13dN09GUMgWvGEy?= =?us-ascii?Q?Qn0qP7PoXSsYA4Htj0vmqKgkKGuupq4bvRAMJPsxgECOD6UmqK8/gmktelMZ?= =?us-ascii?Q?Q+VpGng7kbNIrvlkPajYsiyedG1aePK0utKXTSPqPBamzHdZmVMzt8Ebh2CX?= =?us-ascii?Q?SqyF2SJx/lYcLvJMDixupj48XY/QefKpGmU+RmtBEw73PS9euRUd7aGXvdRd?= =?us-ascii?Q?ONSxo3qmbKfcJc6fKLhEAdLRWHO2dyOdx5UkNJ6IQ8kBib77E278q2J56wx1?= =?us-ascii?Q?YlhlRqflJAfwvnRvCReK6AthQIoOueDx6cuPLPO7F2/LGf4gXUGjkwIDPage?= =?us-ascii?Q?GI7UWUbDJwofjn17XnTyD0WbhVqTfxeXY6QxAZw7/owC4Gra0Pu4dwYfbPP4?= =?us-ascii?Q?DDH+fow6nKYovR10RsDP2jUviojkH/Txq1+/tmiLPJGGcgIMqg2EzjNseju1?= =?us-ascii?Q?HalvKG3giMxqUeb73BNeZk7N7KVIOsdmBvXGkg8tWnucZeIaH8bgqJVaqjhs?= =?us-ascii?Q?BiwWvUd9n0WsgKcMAXUk2/x80M8gG2U1vazDNt7cZd7LjKHHtHXfrTBPlQ?= =?us-ascii?Q?=3D=3D?= X-Forefront-PRVS: 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:TEMk+dTpr/TlQ738oO70uhwDvHuaxywWYTwHcMo?= =?us-ascii?Q?GlxrFZRK6oMX/5TQ/rGJAC5077aNt/tBsNW7rwmB7Lglk+b2HWMjUuKFBYoA?= =?us-ascii?Q?7QA4UVpetnOPUxS8C5fCbX5Ax2KDQyrn5h+0SO9E+9y1XObGcH0cjRkpYqv8?= =?us-ascii?Q?zjrptj3CBD7YMgyI2y0KxMixbgPXjKI6LI7bSPGuKI6sbHl9vr3dJVUZExmr?= =?us-ascii?Q?JkhuPCMgRPYwcNNdO0pvaJ2L4pJXpZQkiu7XtHx8xuncmeBdZmEqusdZ+34g?= =?us-ascii?Q?IvKW6ugLeY9LcIRF0p0KHtaXqUDZFT/Sct2tZ9pKXKYnUWTOCGwiMFBUz3wR?= =?us-ascii?Q?cC+XSkKzcSQutwRuuyMkDrQPj44V/ghe5/NuoRQgtrD8fs0Q7327A5zkRlfO?= =?us-ascii?Q?TJoTqfp2FVFdzGFPI3Oz7yYGTwBxNqw8J6Zi4Lfe41jWwKOns96yAdGV5B43?= =?us-ascii?Q?7z6xp7BTCnRTKRmbsDVMlM8V8MLMPumY0wSpL4k7r/JIigWI5aPCMfhlM7b8?= =?us-ascii?Q?k9zd5WGtfCxecYJbX2dXMKcfLerkASnt017UHK6X3xnPYb1L/OmZnD/upUi+?= =?us-ascii?Q?7G5N5XhmKTzdogOV4ljhqBBknYA9wn3QGyY+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yw99LLaHvIm9hciDANxUE+Hja3y5h0w3wWr8znl6GKqtZcB10O6ifxqjDsd6rrxTkTDbT4/Dzz63IgHkk2DVyaoehoiq6JWnuCzhsdVtmrbqN14QJVJpnSrJAGCYKGIUyOEc3A3cqXQlay2wiM0i4h0J1LWyUU3ZX654P/fdiTDBU31aokAZ51gp9tBOyTG0/+zqXvu3zplmepAKs= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 20:njp7Ci8YvPswVa9F6bFkgdtNyERgqH/fvC0mRx00v93+P/r/h6gAEZWmNZjtLUkjTd6lh5GdcWAgWQFvca3echxFRMCt30aOK1EHVN1g1FpF9km+XryeD2VeMqRXlErRx4YAmAvfAv1LDj8ZHM+Gfdu4P0jxxHMJTAAAn4D8NNI= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2017 12:09:28.8542 (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.99 Subject: [Qemu-devel] [PATCH v6 01/13] char: move QemuOpts->ChardevBackend translation to a separate func 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 parse function will be used by the following patch Signed-off-by: Anton Nefedov Reviewed-by: Marc-André Lureau --- chardev/char.c | 81 ++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 30 deletions(-) diff --git a/chardev/char.c b/chardev/char.c index 2b679a2..839eff6 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -556,17 +556,23 @@ help_string_append(const char *name, void *opaque) g_string_append_printf(str, "\n%s", name); } -Chardev *qemu_chr_new_from_opts(QemuOpts *opts, - Error **errp) +static const char *chardev_alias_translate(const char *name) +{ + int i; + for (i = 0; i < (int)ARRAY_SIZE(chardev_alias_table); i++) { + if (g_strcmp0(chardev_alias_table[i].alias, name) == 0) { + return chardev_alias_table[i].typename; + } + } + return name; +} + +static ChardevBackend *qemu_chr_parse_opts(QemuOpts *opts, Error **errp) { Error *local_err = NULL; const ChardevClass *cc; - Chardev *chr; - int i; ChardevBackend *backend = NULL; - const char *name = qemu_opt_get(opts, "backend"); - const char *id = qemu_opts_id(opts); - char *bid = NULL; + const char *name = chardev_alias_translate(qemu_opt_get(opts, "backend")); if (name == NULL) { error_setg(errp, "chardev: \"%s\" missing backend", @@ -574,7 +580,40 @@ Chardev *qemu_chr_new_from_opts(QemuOpts *opts, return NULL; } - if (is_help_option(name)) { + cc = char_get_class(name, errp); + if (cc == NULL) { + return NULL; + } + + backend = g_new0(ChardevBackend, 1); + backend->type = CHARDEV_BACKEND_KIND_NULL; + + if (cc->parse) { + cc->parse(opts, backend, &local_err); + if (local_err) { + error_propagate(errp, local_err); + qapi_free_ChardevBackend(backend); + return NULL; + } + } else { + ChardevCommon *ccom = g_new0(ChardevCommon, 1); + qemu_chr_parse_common(opts, ccom); + backend->u.null.data = ccom; /* Any ChardevCommon member would work */ + } + + return backend; +} + +Chardev *qemu_chr_new_from_opts(QemuOpts *opts, Error **errp) +{ + const ChardevClass *cc; + Chardev *chr = NULL; + ChardevBackend *backend = NULL; + const char *name = chardev_alias_translate(qemu_opt_get(opts, "backend")); + const char *id = qemu_opts_id(opts); + char *bid = NULL; + + if (name && is_help_option(name)) { GString *str = g_string_new(""); chardev_name_foreach(help_string_append, str); @@ -589,38 +628,20 @@ Chardev *qemu_chr_new_from_opts(QemuOpts *opts, return NULL; } - for (i = 0; i < (int)ARRAY_SIZE(chardev_alias_table); i++) { - if (g_strcmp0(chardev_alias_table[i].alias, name) == 0) { - name = chardev_alias_table[i].typename; - break; - } + backend = qemu_chr_parse_opts(opts, errp); + if (backend == NULL) { + return NULL; } cc = char_get_class(name, errp); if (cc == NULL) { - return NULL; + goto out; } - backend = g_new0(ChardevBackend, 1); - backend->type = CHARDEV_BACKEND_KIND_NULL; - if (qemu_opt_get_bool(opts, "mux", 0)) { bid = g_strdup_printf("%s-base", id); } - chr = NULL; - if (cc->parse) { - cc->parse(opts, backend, &local_err); - if (local_err) { - error_propagate(errp, local_err); - goto out; - } - } else { - ChardevCommon *ccom = g_new0(ChardevCommon, 1); - qemu_chr_parse_common(opts, ccom); - backend->u.null.data = ccom; /* Any ChardevCommon member would work */ - } - chr = qemu_chardev_new(bid ? bid : id, object_class_get_name(OBJECT_CLASS(cc)), backend, errp);