From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S10wa-0004h5-VZ for qemu-devel@nongnu.org; Fri, 24 Feb 2012 14:36:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S10wZ-0003WK-VC for qemu-devel@nongnu.org; Fri, 24 Feb 2012 14:36:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S10wZ-0003WB-Nj for qemu-devel@nongnu.org; Fri, 24 Feb 2012 14:36:39 -0500 From: Luiz Capitulino Date: Fri, 24 Feb 2012 17:36:28 -0200 Message-Id: <1330112189-29280-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1330112189-29280-1-git-send-email-lcapitulino@redhat.com> References: <1330112189-29280-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 2/3] boards: introduce machine_print_all() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, afaerber@suse.de It prints all registered machine types. Signed-off-by: Luiz Capitulino --- vl.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/vl.c b/vl.c index 728eb36..ced7068 100644 --- a/vl.c +++ b/vl.c @@ -1198,6 +1198,20 @@ QEMUMachine *find_default_machine(void) return NULL; } +static void machine_print_all(void) +{ + QEMUMachine *m; + + printf("Supported machines are:\n"); + for (m = first_machine; m != NULL; m = m->next) { + if (m->alias) { + printf("%-20s %s (alias of %s)\n", m->alias, m->desc, m->name); + } + printf("%-20s %s%s\n", m->name, m->desc, + m->is_default ? " (default)" : ""); + } +} + /***********************************************************/ /* main execution loop */ @@ -1992,7 +2006,7 @@ static int debugcon_parse(const char *devname) static QEMUMachine *machine_parse(const char *name) { - QEMUMachine *m, *machine = NULL; + QEMUMachine *machine = NULL; if (name) { machine = find_machine(name); @@ -2000,14 +2014,7 @@ static QEMUMachine *machine_parse(const char *name) if (machine) { return machine; } - printf("Supported machines are:\n"); - for (m = first_machine; m != NULL; m = m->next) { - if (m->alias) { - printf("%-20s %s (alias of %s)\n", m->alias, m->desc, m->name); - } - printf("%-20s %s%s\n", m->name, m->desc, - m->is_default ? " (default)" : ""); - } + machine_print_all(); exit(!name || *name != '?'); } -- 1.7.9.111.gf3fb0.dirty