From patchwork Wed Jul 5 14:01:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9826587 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 ADE0460317 for ; Wed, 5 Jul 2017 14:08:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92E7E283C0 for ; Wed, 5 Jul 2017 14:08:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 874DE2850D; Wed, 5 Jul 2017 14:08:46 +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 24A2528506 for ; Wed, 5 Jul 2017 14:08:45 +0000 (UTC) Received: from localhost ([::1]:46407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSkyw-0000eP-Cu for patchwork-qemu-devel@patchwork.kernel.org; Wed, 05 Jul 2017 10:08:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSksu-0004ht-7P for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSksq-0007j8-Uk 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 1dSksq-0007gG-L0 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:24 -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=OJ1Iyzh+xB33TJThO3LFWYaMi7qIGpb6Fi3uzTn9OdPqvIHwWz/r8aIo0R65WvAZLUfT9qu6kygihwZYrIsHMirnTENRHsE24E4GKYOEhrP1sxI4fGijXsVmhTnrT6V7rkX+t/inSwdoWJO9uB06OUgyJJkMId/N6vFAarGLMg0= 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:18 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 17:01:52 +0300 Message-Id: <1499263324-15184-2-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: 02c62d74-ac50-4a90-2635-08d4c3ae736c 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:kgkMbzV1U+o0h0S0ThJcpb72o+zBhwDmbln/qKHalcQlW3tiQNcE8LUpCDR8AHubUBtNzvru8mQnzDMYs0zG6AbTBg3kl6nRIwtVyPbxPvcEYiFSZnhXNkmRbduclVUCtxJH4rlAbQspdAR8gjgxWVlk+P06nQfgN001/xT07mgMguT3Cfz/3xhxKXpnZOKNuj0Yoqb5ShQOLKM4Tc6/xrLhk3La1hjO/lIbZd6pvrWsWSPOsqsqhYEM2KhhaQ2/bb8pGb9tQ+w3yvd8WuLBJ1PRDImXBGo9CYiBPoRI2rC+LtNMxT9U7nFQE0uom6t8gKvhYnCZPFEfBVLV0qAOihaS5eetbbYcBjSFR4+Imo2xX89H+iQgo19q7U3fEVOYkcGvKXxghDk7zxluxYNVxdHMx7/x+v/NbkmFGBjXHL+9pxV9r7kWgsZdVbLjP4N49SZh1yFlybfVofSf3Zx92iHVs9/gAGG+xhHGsva72SZeDCp1BKegemP34uFOZr7fWKK6Uymf1RGuNja7JYUS3I1L4GkfaSJ5BS+Skl/SOoc9lxTVTtbHGmsoqi0U5FTl4owNb4mvdYbXvRMWm00LASBspUKthTnSsoiUW3LqzaI8YSHV+5q/mWpg8RS+mekYEJFT4ON6hsDypnzyUCXTNvqlGqR696BxwJKptmeXUy9IuEg44+PFmpOXFEDCeevhf217maaMB2j5Hu79+AFCv3kkx0ju72addep7TuvUABsPjOY+a4V6b2MqEdvhv+KA X-MS-TrafficTypeDiagnostic: HE1PR0801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9GtRDYrtloB9vVgnynSxZ4JgsGRU2pvK0= 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)(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:TBxMbJW8LjG6Vo3liIrdFfUhtrPRFgPJ1zY/YEFb?= =?us-ascii?Q?VjYXZn/ELzlv5QQ73aR4bgKG3U0MaWtNMgoABy42ysdFjkXHZF8h3Zi2GZ8y?= =?us-ascii?Q?uO2eIOSfVFt+3VCkide/vnGWaRUI3ubXEuebc7CtIlQhfhyApLU9BQ0bDPd5?= =?us-ascii?Q?3NWToEx26tLL4S9pF43VRruSO8Y3iHxS8kkzbLffkRdF4wQ1c7pK2perGR1H?= =?us-ascii?Q?6NL+a3kMoGR1cDP1Lo6wKhWd+dyIopB7loMeZM4JspO3TQ8JW9LUTfRSG7Sf?= =?us-ascii?Q?YO/XX5JIn3m9tnf/P1rp72zRSdwLmIV+cirBoxJle/rmn9zi2kF5pp/zr3lO?= =?us-ascii?Q?PeSbd7/MWu0DO347gKlyWxupQ0m91sZF4/PTljw9Jkpa5PyxsQMe/x4yvlkV?= =?us-ascii?Q?Y0evMPr8Fkp9MQGGAy6+IjS1gaolYgz1Mvs5X+QY8pMduWGNIO/SRM+q1qfi?= =?us-ascii?Q?tjBbBf4G5fKx7CDi1w8W8j8VmJDHC4ucmD7+WSm+iSd4g7ARnJ/Mo6HDWa9J?= =?us-ascii?Q?xTaOWEJ4lIbxUI+PlpKeAya8I9QoOTk7JJ5/UK0p/ischwcpomLs7kWlQkbf?= =?us-ascii?Q?pPzY92Ym4E7VUQSn8taYLEcLcSaPzbNbmuW0w9H0I+rfPuZglPh7vpRgKNwK?= =?us-ascii?Q?Wkz2b/NRFyeO39UDtZk6DkXNWgPwoA5GJ2qdm7kWIbSxYV4g2u6qVfjf32cm?= =?us-ascii?Q?wcs4RGd1o2ECTeDGnZ37RLnSyUBWRs5JbgmprV/KQRnSLEWayVeiJm7VbGzw?= =?us-ascii?Q?4GxvASLXdnK/AEQUARgPZ5ZNJRj6EzbPVWjgR+odESfYAlVc+UvAyMASP+Ir?= =?us-ascii?Q?0oZAThu/QAJOGzBWzeLD82kOh9o6FUZB7Vc7cGPx4+tpypuiG11QFlPCoOUC?= =?us-ascii?Q?JuueiocTR/7lhztemZWzghYIpGPHS8+INYzEeXFM8h8G1iIimgIep8TpTlmg?= =?us-ascii?Q?6lNTSdx02p1t28gt2ajFhx453ie0K+b0kCXo3F2jxQNZKKG3FXfE69Of8E4O?= =?us-ascii?Q?LHMUw1cZAtE2KJCIzYMR0Zd1D6WpCoCsxbyhuuopgDRsFgVdR0bmzOfzqJVg?= =?us-ascii?Q?dwMcZVVKTEOgYIegxGGfqEcE3IuaFXAVZZX4WRXUD3LFL4xNAUr4TGt5IO4T?= =?us-ascii?Q?9Glsv2zyxMf/Z7YkmWyCnj50BhzWltEFnzb08/Rks33bQjf5rK5LNUZB0ta1?= =?us-ascii?Q?qkeKg1Nj9rL60BI=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:LziwCOfOmyHL3XNrocioX7NkajusCJqhqZfma+/?= =?us-ascii?Q?huGEj+cudqpQY+onGh2TSA8PGyU5PothA7hZWw7V8rMr63+HicOw8R3Ol7XV?= =?us-ascii?Q?yIRdOaVbZRiapBpED9Ti0mTc0x93qU45GVbGCwhh1P7DZ7glURtOZd3wyr6Z?= =?us-ascii?Q?9E1w1OvL2Jq9LTk/LeFl+u2JxVmCMSWpmvl3aH0IlnDe0qnQEXux0s77tbRa?= =?us-ascii?Q?raeOFpOsz3r6My+zu6jGdXeh+m1Bobrod6sTzaP70WabgLbDHwK7MKHf/ITT?= =?us-ascii?Q?W4UpQr/q8vGCAIofOBk3IgpXzE4+JJPXkc1z9wWraOSJpJ4ejV16PTXFh0zX?= =?us-ascii?Q?3ooUdcOf0lYFNAMKhh5T7osHkTn55c0CjA5LN04iJrn10mRzRokeNw8ZR6yd?= =?us-ascii?Q?CMzcZXpDJiAvhECDC6grAhVlIXi6T3pKsn1yQYpc0bJqXlIuVg9T0p6lPWKr?= =?us-ascii?Q?VfGjxApcgwDQZ0aDfTg2UUIv8FYNzVYp6Q/0DnaYNxrJAuHAbw36FYeHn9PU?= =?us-ascii?Q?y56fyMpsZpj9tcSyNHCH4rY32L234qZITIQBu7C8zBjp3DLJ7hv155OeT6wz?= =?us-ascii?Q?50HRjPUfUI8Vi3V5u1vRd7gLq9qdvccXsbxvR21eIueWF+KiMXCPEbo/2TLK?= =?us-ascii?Q?R3OjbyVu0MNoyvnRqbamczf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gy8AOn/c3FldCUWg+Us/gWkJkyWgIM5PZ1nG0GAl48qpszD3D0tlUdoXrI5ZKEGyXGYn819lzSrFOuQZlmgJDT0DcJrQj0T/q6DbpOkjA/KhKnqb8pEaUHMSvO9DLZr6BgL/tpsOhSdTCStAxVcMjndAjXI= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1996; 20:5C2GhQJZh0vLW/rhJgsMZzJ/5gdD2KkhqxT8THb8Fqmfe+tpZfx/YPrN2HykZSSLyEFdF0/k8J0/ekusmujl1KdAYdXoXfJi71+k8Vpo4SFGsRANxu382HkXOXAMUKgOFJL3OSoDA1cipfJd0K/ezIlzb2xp4Rrnm1jAcwCPyGg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2017 14:02:18.2556 (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 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 --- 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);