From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhlWm-0002DO-ML for qemu-devel@nongnu.org; Thu, 01 Oct 2015 17:36:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhlWh-0004qQ-NK for qemu-devel@nongnu.org; Thu, 01 Oct 2015 17:36:36 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:56587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhlWh-0004pM-Ga for qemu-devel@nongnu.org; Thu, 01 Oct 2015 17:36:31 -0400 Received: from localhost by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 1 Oct 2015 15:36:30 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 345A53E4003B for ; Thu, 1 Oct 2015 15:36:27 -0600 (MDT) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t91LZEEO10354994 for ; Thu, 1 Oct 2015 14:35:14 -0700 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t91LaQgJ013014 for ; Thu, 1 Oct 2015 15:36:26 -0600 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Roth In-Reply-To: <1441997621-3284-3-git-send-email-marcandre.lureau@redhat.com> References: <1441997621-3284-1-git-send-email-marcandre.lureau@redhat.com> <1441997621-3284-3-git-send-email-marcandre.lureau@redhat.com> Message-ID: <20151001203852.32707.20276@loki> Date: Thu, 01 Oct 2015 15:38:52 -0500 Subject: Re: [Qemu-devel] [PATCH v2 2/4] qga: do not override configuration verbosity List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org Quoting marcandre.lureau@redhat.com (2015-09-11 13:53:39) > From: Marc-Andr=C3=A9 Lureau > = > Move the default verbosity settings before loading the configuration > file, or it will overwrite it. Found thanks to writing qga tests :) > = > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > qga/main.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > = > diff --git a/qga/main.c b/qga/main.c > index 18e1e1d..aa6a063 100644 > --- a/qga/main.c > +++ b/qga/main.c > @@ -1083,8 +1083,6 @@ static void config_parse(GAConfig *config, int argc= , char **argv) > { NULL, 0, NULL, 0 } > }; > = > - config->log_level =3D G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL; > - > while ((ch =3D getopt_long(argc, argv, sopt, lopt, &opt_ind)) !=3D -= 1) { > switch (ch) { > case 'm': > @@ -1332,6 +1330,8 @@ int main(int argc, char **argv) > GAState *s =3D g_new0(GAState, 1); > GAConfig *config =3D g_new0(GAConfig, 1); > = > + config->log_level =3D G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL; > + We currently handle config->state_dir/method/channel_path defaults after config_parse via if (!config->blah) config->blah =3D ...; I'd rather we do it for this too for consistency, but not sure we have a reliable indicator for determining whether or not config->log_level is unset (GLogLevelFlags enum doesn't have a 0 value so that would work, but it's hacky to make such an assumption). This avoids any hacks so it's worth the trade-off in terms of consistency so: Reviewed-by: Michael Roth > module_call_init(MODULE_INIT_QAPI); > = > init_dfl_pathnames(); > -- = > 2.4.3 >=20