From patchwork Mon Jun 26 16:45:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9810097 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 8B64B60329 for ; Mon, 26 Jun 2017 16:50:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 850CC2811A for ; Mon, 26 Jun 2017 16:50:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7847C28550; Mon, 26 Jun 2017 16:50:28 +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 53B6E2811A for ; Mon, 26 Jun 2017 16:50:27 +0000 (UTC) Received: from localhost ([::1]:47636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPXDW-0004Yx-7g for patchwork-qemu-devel@patchwork.kernel.org; Mon, 26 Jun 2017 12:50:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPX9n-0001t0-Gk for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:46:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPX9m-0002mC-IU for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:46:35 -0400 Received: from mail-eopbgr10138.outbound.protection.outlook.com ([40.107.1.138]:62048 helo=EUR02-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 ) id 1dPX9m-0002lO-0k for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:46:34 -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=J0ymrZWM8IGJwDDjK1fWpDoadszkNJzYpiVtiFR1LWk=; b=MEcUU84k76I9y3yKJB5sC/qxVTtElFqlR9aKnto0pFO0mZVuUl7gpyLiEwKpNyLzw839C7zsu1T5j8B3y6MnRp/8LWOSZdUjcurVIC7n1sBVdDl2fLVxrK/X4Ce9hjzZp0l1yIERy6vmsZ1VYrLg8Qn5OVMhefWQSpzu8JLgcAw= 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 VI1PR0801MB1998.eurprd08.prod.outlook.com (2603:10a6:800:8a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Mon, 26 Jun 2017 16:46:28 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Mon, 26 Jun 2017 19:45:38 +0300 Message-Id: <1498495550-72357-2-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498495550-72357-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1498495550-72357-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HK2P15301CA0013.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::23) To VI1PR0801MB1998.eurprd08.prod.outlook.com (2603:10a6:800:8a::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 26927071-f2fd-46c5-bda0-08d4bcb2e626 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095); SRVR:VI1PR0801MB1998; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 3:SMQJkwM86OWagA+HchwxzRLzN9pWE/VJU9W7zBkw/8IM+D0i5NIq/fmFIG8wkbp8s8wQO4vsqMIYHY+gSO3aGlQZXBfyompNuH0Ck4mC4wIncR8o2CUaX0ignTgw3EIqzuQaSRVIpHAn3Q7i6bDH4LMpyIVJeTXROTK57JBdItsud+i2TKjQ92AjScx7YV+JqN9jKrDTKwzj1kBayW5y64Lb9j/MvpD+xfW4RivC8h2ftWGFwizVGYEXaZY+yAk1M/iD9+TnV3ygTsO+cTE6al3LdCpdVi3NjHFAz+wKla65kjaPEjR5uQeh0YGAn/StErhrgCc9lrPzHTt3uOWYKfx9MegCG/cjVkQnG+dTUwxkvnV4o+zWHmyg8An3hyMv+HKlOOrrdAyDIC75lllIw1FgnN+Uz/0659tZ7BDnz9QQncmNa4USLGTgPw9rVWr+vyTCweQFb8bflGqv5b7J1qvl4QnAIrKuGQ4wTLjXTGfe1ruyh6dljfW4Gd8SZlP15aQwkl1CN84TD6uo/lFUm/mHQXxAdilVw1dvqEMYgp4tN9SAgVAgRgXrOmN00Ra1oaE+P61DYXYwQ0v30jDelgiJE/2ZBRuVF/qScobM7YWvdYudlpZG+2ecFEo1TyawsjHkqsrlpBeXzR8taT0OOMKzgvZDa5pg5XEIzZ8rjyvnJskNjoISt0p/vMR4bNts X-MS-TrafficTypeDiagnostic: VI1PR0801MB1998: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 25:xa2i1SHfRuWZ2Ik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9JW8QGC3x6bJQsGCvwMMTDlrnqayKo594mmLrm+c2l5GC1Fip7PDf34r7x54QNEE2sSghyaJTXlP/HXpsyaV8bam/73DPkWUSkIUhYDpZWY6L5Erj2eYZJqCNSV6Txzq53Xq4vH1pkLXR1sOO76PoW/7LzQTSbiIkP4kAaaeCaCttMAFfxO16mT/2wGk5L4u0F5j7S8ncGIRnlJ/kG5qhgHMkWYHwkNQ3tM8U6r52tFKL1/YJBDqL4ua+9ln4wps357Z+nl9yHrrm8SIOoYvMrZS/XeLMy8TTJ9/53C2avK5wNbsow7wRI305bQRBo9qHF/hhQ4L4WZQ8laii3804B5VBH/CUy/BhWGkRNNTD1fc9SYn0vyvnDl9Btf1Sb+2GfEo62QkMzC7oOhJV5CjBbRDedFYyTGwjUs0Ceilmgzg48Db9wtraL/xeY6sSQObzwN2FzHHlXEsO7SG5Cv7+6qtel70LrxaZiULYPb1qcnw3PalVLuycA42UEx5eRbSdfqkT0thosxDtqHyjjJQZ7GZ/66ZR+4WCi9uqAhU0ZLoVk5k+84= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 20:lyYraUKd6vuo2YZkf0V18O5hzEbOp1oH3z1X4gtuEjNaoWcGq8dkhht4kiuaElEXRdQFeAr7GohrHd86CGA9eTl2Awk+zluOWvdn8YmdRt97aMnQ6FeN3BjbOYqY7omiVpOx8keVYOkVHkJ7xRYXVEam1OxEe8ApaUDgCBtkFqz58syl0F21RLNUYuOGJ+7CVW96JPEUbYV+j20P8eyGfomwtRLWIS3G7OajwJHqPfIFVI/eT/VnWTPpQJIURTi5f9NKI/z9nr9rkklvxczgJ+BsIdAmRsvxxA3PGXcyc+OE4+ySHJibEPjfvu5oUbnEHkzo7LyOMt3GVXlFPLgFAxDdsyBNqKkKhyTmANTpomVdFlNbl2l7JHMg6HaYy6FsgX2wygrkhIlMd3t4BtWmEOKlNucekCcl8twStofvgDI= 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)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0801MB1998; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0801MB1998; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1998; 4:YYmovMPWH0o9tCj/lmj0IeklzDtMQchIRGYDXgwC?= =?us-ascii?Q?qVnSdBem1CIC2wfRUmNZSYRSGI/eQNVJDOmm3RRtyXOuVkqhvquZJhZA/EOf?= =?us-ascii?Q?Hk9FIHt7oyB+LGiY57VXOtL+qHLl3AasJmyW82R4TZdjX8TCXn//XcX6ZkH2?= =?us-ascii?Q?Hbq/NKRVH5rSuXSStVso+ewrjV//y62jYiXf4y6ukyURteDYj+7Ex0duKiyY?= =?us-ascii?Q?wbe3sEsTmBtUKfH5i74E572/rfq5jattyreg0A/GYrhsBhxZtG/aw2UflFh+?= =?us-ascii?Q?fqptM20lBuIastTmCAFLBwzIlM28I7t6O+LOMC461tV6d4Y8JOXsY/HoBv7l?= =?us-ascii?Q?XhInLhY8N8zzDlT6fVkF4kfGCkF8XuQPGDgtuZNI12ZXgwzeKP1PVOBx5+/8?= =?us-ascii?Q?14Y2sWZKQw/iapAwtXvDllZAsQJBtV2Hpbnr7qPtuOy2g3XdMNYLLXiLIoui?= =?us-ascii?Q?pm+Z2os1ieCXl5iE5JlXxBsU3oMeY5kcfepkxMTUWRN/jwbWIARwrmLzl651?= =?us-ascii?Q?IhQRB18X344eho9iL43krHbYX2GVHkZ0oEGROATtEVZwfGSMN64kG1G8PVgw?= =?us-ascii?Q?+mcXbXmRi+j9VtiA96y1PjQOAneDrQ4hVQdMK2I+81n6fDgXJfY1LMB3f+at?= =?us-ascii?Q?Y4QRRJeL2GnGOgn9nTAZRt1DepCPhw65Sa0JDdLjUHPObkQBsy6wwa8LuK3F?= =?us-ascii?Q?N6xaYDG0CCNPfR3et8nJOKzISK5MdDc5RLLV4JIPw1l8VrPbpg3nOfJ0dsAR?= =?us-ascii?Q?BXWHKXSvejjOFV7pMr/U9AhXzsSgNSP/NFvhe5XLaehLJQoNK2mTNa7juj39?= =?us-ascii?Q?xHGRfMGfNuUbnZnGb+biQcmwghDIHiRWRbkR9yNKMWp28XiusmYGTl/ABTKx?= =?us-ascii?Q?HKFlEJ9rCXjzf30T5WbJcfqY6MncI+VnCbz6Dp08uJSPakNGdDngfUd5NqBk?= =?us-ascii?Q?UiaUNbEzyuNRo9bc72gYVgdg01jAsEQXctnbDoITiHrJ+k7n/3pPwyE5x/5U?= =?us-ascii?Q?ir2va51IbvOZMYEKMgkWyDqLqk2sBpsAHoC9/1kfUS5h5UaUnuq5JjpHVMTV?= =?us-ascii?Q?rF8RZDnOSzLpMXOrDrDey+6FqeLICT+RmpEF+y/TTMywolDaTWsgmOeV9RgP?= =?us-ascii?Q?wtN1t5x5vP2a9u1DvxcmB/oXnxJ+xMxT72Qx7lGfRG4WNXfqbEPGaDu9hf0l?= =?us-ascii?Q?7DibAALmoLpvocI=3D?= X-Forefront-PRVS: 0350D7A55D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39400400002)(39410400002)(39840400002)(39450400003)(189998001)(86362001)(53416004)(478600001)(53936002)(6486002)(5660300001)(50226002)(50466002)(42186005)(48376002)(5003940100001)(36756003)(81166006)(25786009)(50986999)(6506006)(76176999)(3846002)(66066001)(47776003)(305945005)(33646002)(2906002)(38730400002)(110136004)(2361001)(6116002)(107886003)(4326008)(7736002)(6512007)(2351001)(2950100002)(8676002)(6666003)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1998; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1998; 23:JMjYFyr+zWv6CgkwvhSYsv3WdcK6IF0FeeMxWtT?= =?us-ascii?Q?cgZUUrE8l7fUL6USI+OuWcrsIXvD5/qGhd+eV7MSqjiUd2wbX7BCTyyL8SDI?= =?us-ascii?Q?9Bjv0EDUz6z1LzpJWE/HsoUQRpb4z8BSKapsESW9olnZ92HD5xroVEzAXfX4?= =?us-ascii?Q?ZRRWuu/nnmIHtpG3+2E0M7Lil5OHlAJ+xLX1hRQ9+vLIGTQ8ZGDS70kojNF6?= =?us-ascii?Q?IBxrrm6lp8nfQE+ImOYGJZpSGPJyOWDVlMSBCCDnImREgJe3n1lQuSZ4Uirl?= =?us-ascii?Q?nHElt2Sxp3tNpa5nNmuvFnHHxt/bFBVnCSJvzGYwuUifBADlsx+PBmN544/b?= =?us-ascii?Q?gi15vDxybR99Ka/hUxh6nMTwrwc0EAcRqBqkl6wcEkMLCPrCUhCc/tLIGp1s?= =?us-ascii?Q?0jlKMcA2MEc4yz3+LyRD2ejle6ATx8ezZc1vZM0mlYY2M/JbNVneiW23CCgq?= =?us-ascii?Q?EWfsxRdxRrVOTCDKPlaRygNxRJpYJANwbXU3RgwkNGRvIAxsDWkUO4Gl0ROI?= =?us-ascii?Q?U50ZC5EI672v1D3CZ0qlGJa/DQjs/uMzG3v0J3qHOQ3Z9uKhpO2L7FV9N3PP?= =?us-ascii?Q?p4DkiCfgeGYxKhmDo4ZNsPSwLqME6poWXPcDjXuYJIoFk6s4u5E5hS/SvoEF?= =?us-ascii?Q?GUTt4qvOX5CMhIqxEUByOgQ9tziKX5u+ois3r+doUM/8dCjYzwcsgkZn6UxP?= =?us-ascii?Q?k/r4t5ne3AgFIuZrLrMhlUU0snr5lYk7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1mhn4tec+g/BI0yepPsVwhC9z8mBVEXasrgPgvXlfP1Hq3BtftS7lE= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 20:vlvTmGu/SpRNZp3t07qng6OQaP2hFGT7dCair3VSbGEBYYUIh44aK2mIAsKzW7fp9Fb4lRXUBttHFndAQ5+3wiM2qVc7Bgu8vg7kLudeDA7XwzQPZXLu5t8bgBrb9LMAAFwcA7e7TfH8RVvvd+ANomtJZ0jDpDjLdqTpxU3oDYo= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2017 16:46:28.0550 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1998 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.1.138 Subject: [Qemu-devel] [PATCH v4 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: pbonzini@redhat.com, Anton Nefedov , den@virtuozzo.com, marcandre.lureau@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 bcfc065..f8817c5 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);