qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Leif Lindholm <leif.lindholm@linaro.org>
Cc: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] smbios: stop ignoring command line options for TARGET_ARM
Date: Wed, 21 Dec 2016 11:51:02 +0100	[thread overview]
Message-ID: <20161221115102.251224b8@nial.brq.redhat.com> (raw)
In-Reply-To: <20161216152319.12494-1-leif.lindholm@linaro.org>

On Fri, 16 Dec 2016 15:23:19 +0000
Leif Lindholm <leif.lindholm@linaro.org> wrote:

> Commit c30e1565 ("smbios: implement smbios support for mach-virt")
> enabled automatic generation of SMBIOS tables for TARGET_ARM, and
> actually provides data for the "virt" machine.
> 
> However, do_smbios_option() still had an #ifdef TARGET_I386, preventing
> any -smbios command line options from being parsed for any non-x86
> targets.
> Change this to use a status variable instead of compile-time filtering.
> 
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> ---
> 
> Verified on ARM mach-virt with UEFI shell "smbiosview" command and QEMU
> command line parameter -smbios type=0,version=foobar.
> 
>  arch_init.c                | 6 +++---
>  include/hw/smbios/smbios.h | 2 ++
>  vl.c                       | 2 ++
>  3 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/arch_init.c b/arch_init.c
> index 5cc58b2..d4e28c0 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -250,9 +250,9 @@ void do_acpitable_option(const QemuOpts *opts)
>  
>  void do_smbios_option(QemuOpts *opts)
>  {
> -#ifdef TARGET_I386
extending above condition to make it compiled for ARM
would do what you need

> -    smbios_entry_add(opts);
> -#endif
> +    if (smbios_override) {
> +        smbios_entry_add(opts);
> +    }
>  }
>  
>  int kvm_available(void)
> diff --git a/include/hw/smbios/smbios.h b/include/hw/smbios/smbios.h
> index 1cd53cc..2a3dca2 100644
> --- a/include/hw/smbios/smbios.h
> +++ b/include/hw/smbios/smbios.h
> @@ -267,4 +267,6 @@ void smbios_get_tables(const struct smbios_phys_mem_area *mem_array,
>                         const unsigned int mem_array_size,
>                         uint8_t **tables, size_t *tables_len,
>                         uint8_t **anchor, size_t *anchor_len);
> +
> +extern int smbios_override;
Adding global variables generally is not welcomed and one
should try to avoid it if it could be helped.

>  #endif /* QEMU_SMBIOS_H */
> diff --git a/vl.c b/vl.c
> index d77dd86..8e71b06 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -159,6 +159,7 @@ int smp_cpus = 1;
>  int max_cpus = 1;
>  int smp_cores = 1;
>  int smp_threads = 1;
> +int smbios_override = 0;
>  int acpi_enabled = 1;
>  int no_hpet = 0;
>  int fd_bootchk = 1;
> @@ -3711,6 +3712,7 @@ int main(int argc, char **argv, char **envp)
>                  if (!opts) {
>                      exit(1);
>                  }
> +                smbios_override = 1;
                   ^^^ practically turns follow up call into unconditional
smbios_entry_add(opts) call,
so what's the point for adding 'smbios_override' at all?

Also this patch would break build for targets that don't link smbios.c
(i.e. which don't have CONFIG_SMBIOS=y)

>                  do_smbios_option(opts);
>                  break;
>              case QEMU_OPTION_fwcfg:

  parent reply	other threads:[~2016-12-21 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16 15:23 [Qemu-devel] [PATCH] smbios: stop ignoring command line options for TARGET_ARM Leif Lindholm
2016-12-16 15:31 ` no-reply
2016-12-19 19:33 ` Leif Lindholm
2016-12-21 10:51 ` Igor Mammedov [this message]
2016-12-21 12:35   ` Leif Lindholm
2016-12-21 13:59     ` Igor Mammedov
2016-12-21 17:58       ` Paolo Bonzini
2016-12-22 15:18         ` Leif Lindholm

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=20161221115102.251224b8@nial.brq.redhat.com \
    --to=imammedo@redhat.com \
    --cc=leif.lindholm@linaro.org \
    --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).