From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, afaerber@suse.de
Subject: [Qemu-devel] [PATCH 2/3] boards: introduce machine_print_all()
Date: Fri, 24 Feb 2012 17:36:28 -0200 [thread overview]
Message-ID: <1330112189-29280-3-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1330112189-29280-1-git-send-email-lcapitulino@redhat.com>
It prints all registered machine types.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
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
next prev parent reply other threads:[~2012-02-24 19:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 19:36 [Qemu-devel] [PATCH v2 0/3]: Improve machine type functions Luiz Capitulino
2012-02-24 19:36 ` [Qemu-devel] [PATCH 1/3] boards: qemu_register_machine(): return void Luiz Capitulino
2012-02-24 19:36 ` Luiz Capitulino [this message]
2012-02-24 19:36 ` [Qemu-devel] [PATCH 3/3] boards: move all machine type functions to boards.c Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1330112189-29280-3-git-send-email-lcapitulino@redhat.com \
--to=lcapitulino@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).