From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0w6i-0007QT-Av for qemu-devel@nongnu.org; Fri, 24 Feb 2012 09:26:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0w6X-0003o6-B6 for qemu-devel@nongnu.org; Fri, 24 Feb 2012 09:26:48 -0500 Received: from cantor2.suse.de ([195.135.220.15]:42456 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0w6X-0003o1-1t for qemu-devel@nongnu.org; Fri, 24 Feb 2012 09:26:37 -0500 Message-ID: <4F479E1C.2070305@suse.de> Date: Fri, 24 Feb 2012 15:26:36 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1330092792-22455-1-git-send-email-lcapitulino@redhat.com> <1330092792-22455-4-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1330092792-22455-4-git-send-email-lcapitulino@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/5] boards: introduce machine_print_all() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Peter Maydell , aliguori@us.ibm.com, qemu-devel@nongnu.org Am 24.02.2012 15:13, schrieb Luiz Capitulino: > Print all registered machine types. >=20 > Signed-off-by: Luiz Capitulino I'm okay with the code movement, but is there a reason not to make it static? Needs a rebase due to 10 -> 20 bump by Peter. Andreas > --- > hw/boards.h | 1 + > vl.c | 25 ++++++++++++++++--------- > 2 files changed, 17 insertions(+), 9 deletions(-) >=20 > diff --git a/hw/boards.h b/hw/boards.h > index 098cbb7..342a774 100644 > --- a/hw/boards.h > +++ b/hw/boards.h > @@ -33,6 +33,7 @@ typedef struct QEMUMachine { > =20 > void machine_register(QEMUMachine *m); > QEMUMachine *machine_find_default(void); > +void machine_print_all(void); > =20 > extern QEMUMachine *current_machine; > =20 > diff --git a/vl.c b/vl.c > index 81cc5b1..9f9927c 100644 > --- a/vl.c > +++ b/vl.c > @@ -1198,6 +1198,20 @@ QEMUMachine *machine_find_default(void) > return NULL; > } > =20 > +void machine_print_all(void) > +{ > + QEMUMachine *m; > + > + printf("Supported machines are:\n"); > + for (m =3D first_machine; m !=3D NULL; m =3D m->next) { > + if (m->alias) { > + printf("%-10s %s (alias of %s)\n", m->alias, m->desc, m->n= ame); > + } > + printf("%-10s %s%s\n", m->name, m->desc, > + m->is_default ? " (default)" : ""); > + } > +} > + > /***********************************************************/ > /* main execution loop */ > =20 > @@ -1987,7 +2001,7 @@ static int debugcon_parse(const char *devname) > =20 > static QEMUMachine *machine_parse(const char *name) > { > - QEMUMachine *m, *machine =3D NULL; > + QEMUMachine *machine =3D NULL; > =20 > if (name) { > machine =3D machine_find(name); > @@ -1995,14 +2009,7 @@ static QEMUMachine *machine_parse(const char *na= me) > if (machine) { > return machine; > } > - printf("Supported machines are:\n"); > - for (m =3D first_machine; m !=3D NULL; m =3D m->next) { > - if (m->alias) { > - printf("%-10s %s (alias of %s)\n", m->alias, m->desc, m->n= ame); > - } > - printf("%-10s %s%s\n", m->name, m->desc, > - m->is_default ? " (default)" : ""); > - } > + machine_print_all(); > exit(!name || *name !=3D '?'); > } > =20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg