From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUMzJ-0001q6-Sc for qemu-devel@nongnu.org; Tue, 25 Aug 2015 18:46:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUMzG-0007C7-IQ for qemu-devel@nongnu.org; Tue, 25 Aug 2015 18:46:41 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:46376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUMzG-0007C1-BZ for qemu-devel@nongnu.org; Tue, 25 Aug 2015 18:46:38 -0400 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Aug 2015 16:46:37 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id C3DB319D803E for ; Tue, 25 Aug 2015 16:37:30 -0600 (MDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t7PMkY3H53215264 for ; Tue, 25 Aug 2015 15:46:34 -0700 Received: from d03av01.boulder.ibm.com (localhost [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t7PMkYVc010393 for ; Tue, 25 Aug 2015 16:46:34 -0600 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Roth In-Reply-To: <1440540624-7998-8-git-send-email-marcandre.lureau@redhat.com> References: <1440540624-7998-1-git-send-email-marcandre.lureau@redhat.com> <1440540624-7998-8-git-send-email-marcandre.lureau@redhat.com> Message-ID: <20150825224629.11069.29704@loki> Date: Tue, 25 Aug 2015 17:46:29 -0500 Subject: Re: [Qemu-devel] [PATCH v2 07/12] qga: fill default options in main() 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-08-25 17:10:19) > From: Marc-Andr=C3=A9 Lureau > = > Fill all default options during main(). This is a preparation patch > to allow to dump the configuration. > = > Signed-off-by: Marc-Andr=C3=A9 Lureau > Reviewed-by: Michael Roth > --- > qga/main.c | 36 ++++++++++++++++++------------------ > 1 file changed, 18 insertions(+), 18 deletions(-) > = > diff --git a/qga/main.c b/qga/main.c > index a8dda38..979ce5c 100644 > --- a/qga/main.c > +++ b/qga/main.c > @@ -658,23 +658,6 @@ static gboolean channel_init(GAState *s, const gchar= *method, const gchar *path) > { > GAChannelMethod channel_method; > = > - if (method =3D=3D NULL) { > - method =3D "virtio-serial"; > - } > - > - if (path =3D=3D NULL) { > - if (strcmp(method, "virtio-serial") =3D=3D 0 ) { > - /* try the default path for the virtio-serial port */ > - path =3D QGA_VIRTIO_PATH_DEFAULT; > - } else if (strcmp(method, "isa-serial") =3D=3D 0){ > - /* try the default path for the serial port - COM1 */ > - path =3D QGA_SERIAL_PATH_DEFAULT; > - } else { > - g_critical("must specify a path for this channel"); > - return false; > - } > - } > - > if (strcmp(method, "virtio-serial") =3D=3D 0) { > s->virtio =3D true; /* virtio requires special handling in some = cases */ > channel_method =3D GA_CHANNEL_VIRTIO_SERIAL; > @@ -1081,7 +1064,7 @@ static void config_free(GAConfig *config) > g_free(config); > } > = > - int main(int argc, char **argv) > +int main(int argc, char **argv) > { > GAState *s; > GAConfig *config; > @@ -1100,6 +1083,23 @@ static void config_free(GAConfig *config) > config->state_dir =3D g_strdup(dfl_pathnames.state_dir); > } > = > + if (method =3D=3D NULL) { > + method =3D g_strdup("virtio-serial"); > + } > + > + if (device_path =3D=3D NULL) { > + if (strcmp(method, "virtio-serial") =3D=3D 0) { > + /* try the default path for the virtio-serial port */ > + device_path =3D g_strdup(QGA_VIRTIO_PATH_DEFAULT); > + } else if (strcmp(method, "isa-serial") =3D=3D 0) { > + /* try the default path for the serial port - COM1 */ > + device_path =3D g_strdup(QGA_SERIAL_PATH_DEFAULT); > + } else { > + g_critical("must specify a path for this channel"); > + goto out_bad; > + } > + } > + I think this needs to be config->method and config->device_path. It gets fixed in the next patch, but looks like it'll break build bisect. Since that requires a respin anyway: there's an extra space in 'int main()' that gets added in a prior patch then removed here, so might as well fix that up while we're there. > #ifdef _WIN32 > /* On win32 the state directory is application specific (be it the d= efault > * or a user override). We got past the command line parsing; let's = create > -- = > 2.4.3 >=20