From nobody Wed Nov 5 16:17:57 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1535102012774613.6580929430037; Fri, 24 Aug 2018 02:13:32 -0700 (PDT) Received: from localhost ([::1]:40583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ft89k-00045T-SJ for importer@patchew.org; Fri, 24 Aug 2018 05:13:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ft85I-0008EL-KX for qemu-devel@nongnu.org; Fri, 24 Aug 2018 05:08:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ft85F-00060T-H1 for qemu-devel@nongnu.org; Fri, 24 Aug 2018 05:08:48 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53402 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ft85F-00060A-C6 for qemu-devel@nongnu.org; Fri, 24 Aug 2018 05:08:45 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1074F4021CC3 for ; Fri, 24 Aug 2018 09:08:45 +0000 (UTC) Received: from xz-x1.redhat.com (ovpn-12-107.pek2.redhat.com [10.72.12.107]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3927910D1789; Fri, 24 Aug 2018 09:08:40 +0000 (UTC) From: Peter Xu To: qemu-devel@nongnu.org Date: Fri, 24 Aug 2018 17:08:25 +0800 Message-Id: <20180824090826.21370-3-peterx@redhat.com> In-Reply-To: <20180824090826.21370-1-peterx@redhat.com> References: <20180824090826.21370-1-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 24 Aug 2018 09:08:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 24 Aug 2018 09:08:45 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'peterx@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [RFC 2/3] monitor: generate flag parse helper from init 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: Markus Armbruster , peterx@redhat.com, "Dr . David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Just to put the flag parsing part into a standalone function, which will be used in follow up patches. No functional change. Signed-off-by: Peter Xu --- vl.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/vl.c b/vl.c index 16b913f9d5..25e156c020 100644 --- a/vl.c +++ b/vl.c @@ -2302,10 +2302,8 @@ static int fsdev_init_func(void *opaque, QemuOpts *o= pts, Error **errp) } #endif =20 -static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp) +static int mon_parse_flags(QemuOpts *opts) { - Chardev *chr; - const char *chardev; const char *mode; int flags; =20 @@ -2330,6 +2328,16 @@ static int mon_init_func(void *opaque, QemuOpts *opt= s, Error **errp) flags |=3D MONITOR_USE_OOB; } =20 + return flags; +} + +static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp) +{ + Chardev *chr; + const char *chardev; + int flags; + + flags =3D mon_parse_flags(opts); chardev =3D qemu_opt_get(opts, "chardev"); chr =3D qemu_chr_find(chardev); if (chr =3D=3D NULL) { --=20 2.17.1