From patchwork Fri Dec 16 15:23:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 9478027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 29DC7607EE for ; Fri, 16 Dec 2016 15:23:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17AE627F86 for ; Fri, 16 Dec 2016 15:23:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08E03287CC; Fri, 16 Dec 2016 15:23:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 59C7C27F86 for ; Fri, 16 Dec 2016 15:23:54 +0000 (UTC) Received: from localhost ([::1]:32808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHuMT-0003Yh-IP for patchwork-qemu-devel@patchwork.kernel.org; Fri, 16 Dec 2016 10:23:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHuM2-0003IT-2o for qemu-devel@nongnu.org; Fri, 16 Dec 2016 10:23:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHuM0-00017A-Vp for qemu-devel@nongnu.org; Fri, 16 Dec 2016 10:23:25 -0500 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:35564) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cHuM0-00016b-PC for qemu-devel@nongnu.org; Fri, 16 Dec 2016 10:23:24 -0500 Received: by mail-wm0-x22b.google.com with SMTP id a197so36857633wmd.0 for ; Fri, 16 Dec 2016 07:23:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=H7EF4B0qXuyU/L0JudEwL9VYW6Np3MU8d7lhbuVzqEg=; b=HoV19qsHZxgf9dOCAZhg8+ez6j4XeOOeZtrvNotzWlPJuzej0+QkzEZLWLrLZzXSr/ AOJlx1uu6Oi+lx0UnCRr1pokcRH5HKoWlZ3RLaAzmrrPaSlJzVrr2uu7V7Ls34J86zrd kAE8mzixub+CAF4ZdJk5jGPCF50sVp9E7Ewlo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=H7EF4B0qXuyU/L0JudEwL9VYW6Np3MU8d7lhbuVzqEg=; b=t8Gu8Oh2k3uvbRbyn9SxMH0nZptgF7D5MP9dM/B1oo2jc1trqHaiH/n/anDBukVaz3 1g2v8ZZHtCvmgwFInQBq710OmgIQqAPuBLjBt2qpP0dKy3zutSZQM5AhxaBttNNrRKn+ 38t805/qXdms9nYM4lDdl6Teq5B3OclfAITD0JTIm/J5bZfNDt9B1AVSoq8UscSZwzga orJlOpAtEX6CjsXqIRQ0zqUukgNeAwzoCAHazvwFjFlW7J7PLZZxE7fEOUbs7ugiVA30 Uy2vglLql7pk68CkDtmo3IpdqXPR4dvRdTAACna431uGkkjJNhWOK+jldvdRFDymfHhE 9wsg== X-Gm-Message-State: AIkVDXJv6+NW2U0U4H0v7SUewVnLPA50SUFp7MEnDC0lrCVD2mY7xQa9NpStGTU/yli5XaYK X-Received: by 10.28.187.11 with SMTP id l11mr3096402wmf.72.1481901801646; Fri, 16 Dec 2016 07:23:21 -0800 (PST) Received: from mohikan.hemma.eciton.net ([2a01:348:6:8735:e23f:49ff:fe6d:9d26]) by smtp.gmail.com with ESMTPSA id n17sm7273196wjq.6.2016.12.16.07.23.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Dec 2016 07:23:21 -0800 (PST) From: Leif Lindholm To: qemu-devel@nongnu.org Date: Fri, 16 Dec 2016 15:23:19 +0000 Message-Id: <20161216152319.12494-1-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.10.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22b Subject: [Qemu-devel] [PATCH] smbios: stop ignoring command line options for TARGET_ARM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 - 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; #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; do_smbios_option(opts); break; case QEMU_OPTION_fwcfg: