Received: from eggs.gnu.org ([2001:4830:134:3::10]:45557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVfPT-0002sR-H0 for qemu-devel@nongnu.org; Fri, 05 Aug 2016 09:43:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVfPR-0003t9-KX for qemu-devel@nongnu.org; Fri, 05 Aug 2016 09:43:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVfPR-0003t0-Ed for qemu-devel@nongnu.org; Fri, 05 Aug 2016 09:43:33 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 92FC9C057FAC for ; Fri, 5 Aug 2016 13:43:32 +0000 (UTC) From: Markus Armbruster References: <20160721140030.28383-1-marcandre.lureau@redhat.com> <20160721140030.28383-5-marcandre.lureau@redhat.com> <87vazfwgtt.fsf@dusky.pond.sub.org> <657311512.1340576.1470399722491.JavaMail.zimbra@redhat.com> Date: Fri, 05 Aug 2016 15:43:30 +0200 In-Reply-To: <657311512.1340576.1470399722491.JavaMail.zimbra@redhat.com> (=?utf-8?Q?=22Marc-Andr=C3=A9?= Lureau"'s message of "Fri, 5 Aug 2016 08:22:02 -0400 (EDT)") Message-ID: <87a8grs54t.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 04/12] monitor: remove usage of generated marshal functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Cc: marcandre lureau , qemu-devel@nongnu.org Marc-Andr=C3=A9 Lureau writes: > Hi > > ----- Original Message ----- >> marcandre.lureau@redhat.com writes: >>=20 >> > From: Marc-Andr=C3=A9 Lureau >> > >> > Once the middle mode is removed, the generated marshal functions will = no >> > longer be exported. >> > >> > Signed-off-by: Marc-Andr=C3=A9 Lureau >> > Reviewed-by: Eric Blake >> > --- >> > monitor.c | 10 +++++----- >> > 1 file changed, 5 insertions(+), 5 deletions(-) >> > >> > diff --git a/monitor.c b/monitor.c >> > index c9191e5..3a28b43 100644 >> > --- a/monitor.c >> > +++ b/monitor.c >> > @@ -3659,21 +3659,21 @@ static int monitor_can_read(void *opaque) >> > return (mon->suspend_cnt =3D=3D 0) ? 1 : 0; >> > } >> >=20=20 >> > -static bool invalid_qmp_mode(const Monitor *mon, const mon_cmd_t *cmd, >> > +static bool invalid_qmp_mode(const Monitor *mon, const char *cmd, >> > Error **errp) >> > { >> > - bool is_cap =3D cmd->mhandler.cmd_new =3D=3D qmp_marshal_qmp_capa= bilities; >> > + bool is_cap =3D !g_strcmp0(cmd, "qmp_capabilities"); >>=20 >> What's wrong with strcmp()? >>=20 > > g_strcmp0() is a slightly safer version, it's just an habit, I guess it d= oesn't matter here, would you like to change it? Yes. [...]