qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/5] boards: introduce machine_print_all()


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 3/5] boards: introduce machine_print_all()
Date: Fri, 24 Feb 2012 15:26:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1

Am 24.02.2012 15:13, schrieb Luiz Capitulino:
> Print all registered machine types.
> 
> Signed-off-by: Luiz Capitulino <address@hidden>

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(-)
> 
> 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 {
>  
>  void machine_register(QEMUMachine *m);
>  QEMUMachine *machine_find_default(void);
> +void machine_print_all(void);
>  
>  extern QEMUMachine *current_machine;
>  
> 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;
>  }
>  
> +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("%-10s %s (alias of %s)\n", m->alias, m->desc, m->name);
> +        }
> +        printf("%-10s %s%s\n", m->name, m->desc,
> +               m->is_default ? " (default)" : "");
> +    }
> +}
> +
>  /***********************************************************/
>  /* main execution loop */
>  
> @@ -1987,7 +2001,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 = machine_find(name);
> @@ -1995,14 +2009,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("%-10s %s (alias of %s)\n", m->alias, m->desc, m->name);
> -        }
> -        printf("%-10s %s%s\n", m->name, m->desc,
> -               m->is_default ? " (default)" : "");
> -    }
> +    machine_print_all();
>      exit(!name || *name != '?');
>  }
>  

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]