From patchwork Wed Jan 11 19:34:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 90983 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1284964qgi; Wed, 11 Jan 2017 11:38:09 -0800 (PST) X-Received: by 10.55.210.131 with SMTP id f125mr10198629qkj.98.1484163489232; Wed, 11 Jan 2017 11:38:09 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 6si4449312qtw.311.2017.01.11.11.38.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 11 Jan 2017 11:38:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:56592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cROim-00056V-PJ for patch@linaro.org; Wed, 11 Jan 2017 14:38:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cROgM-00033x-Ss for qemu-devel@nongnu.org; Wed, 11 Jan 2017 14:35:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cROgL-0003JK-Gu for qemu-devel@nongnu.org; Wed, 11 Jan 2017 14:35:38 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:34558) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cROgL-0003Ij-80 for qemu-devel@nongnu.org; Wed, 11 Jan 2017 14:35:37 -0500 Received: by mail-wm0-x244.google.com with SMTP id c85so334353wmi.1 for ; Wed, 11 Jan 2017 11:35:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=wsph/MFokDE8YgxQYmHMu1d4MM+WA4OpQF02zm2aTFQ=; b=s2IP9btdUxL2CgbiBQST402DXogl+l7tkdhz2KQhXXo9xqa4Zge6UE2Kr+05UjUJTU 9sHcXRyKNilZkDfy58fMdznPBQA+srjFJYZrfIP6RmXWpk1nT3jwyRLmWa+vIewn7OvD mpZNzGUwN4D/Cxjn/399+txkBM0UzJaOj1ZBT32SLu1yGp0a4tbHg7hnW6mXb7kkIcqi zsJFLxl2AmWTHra2EBLqFOjfRRK23WroDTN4e/ln3haW+Nx9FSELdzkvwvHvLNmg6Tbb Q2JBY6rfv1A1/PWYdLzopl2rO4Io22TPr5goU3GEcLXNnGgZOWCbXBdUVzi4li9b/jRu rNtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=wsph/MFokDE8YgxQYmHMu1d4MM+WA4OpQF02zm2aTFQ=; b=Lb0aqZxVS4k6AOMwbRKtXH7kNIZOvMoYHe9kMjBlk/VlAKvaSplH+XAQBLVbJC/lZM DMCdtzlQaDQ2f9auDNovisQhOmotAcpeK2h3e0x5RCcvliU9Ol+ShI9ZH4ef68WwgH+d rVp0oevmvjbMY6eO/cBhK6zKgoXYEvFd4JMZslR0P4/YKs53qMjNNHQiFp6H2cczYkx2 CaBJIjPZWzWkh1j9s+gRDM6sESMhU+KcyRr+fo/7X/IzRfrCZg2RdMf5LUqUPJv8hc2D xp9JQqD1Z0HqROcMcsEUtDQvvWS/mrWPbrMtJA1keIgeVvGKswViIywbaNlSs5YIMAM/ S9zg== X-Gm-Message-State: AIkVDXIwcfnjmqBV6MLvxxBdfglwZNYPGLGpafWite4yHBzZ3lb7JJSp3noEqsLSU/u7tQ== X-Received: by 10.223.169.114 with SMTP id u105mr4882732wrc.173.1484163335925; Wed, 11 Jan 2017 11:35:35 -0800 (PST) Received: from 640k.lan (94-39-158-71.adsl-ull.clienti.tiscali.it. [94.39.158.71]) by smtp.gmail.com with ESMTPSA id k11sm10463101wmb.18.2017.01.11.11.35.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 11:35:35 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 11 Jan 2017 20:34:58 +0100 Message-Id: <1484163327-111841-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1484163327-111841-1-git-send-email-pbonzini@redhat.com> References: <1484163327-111841-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 04/33] smbios: filter based on CONFIG_SMBIOS rather than TARGET 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: Leif Lindholm Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Leif Lindholm -smbios command line options were accepted but silently ignored on TARGET_ARM, due to a test for TARGET_I386 in arch_init.c. Copy the mechanism of hw/pci/pci-stub.c to implement an smbios-stub instead, enabled for all targets without CONFIG_SMBIOS. Signed-off-by: Leif Lindholm Message-Id: <20161222151828.28292-1-leif.lindholm@linaro.org> Signed-off-by: Paolo Bonzini --- arch_init.c | 8 -------- hw/Makefile.objs | 2 +- hw/smbios/Makefile.objs | 3 +++ hw/smbios/smbios-stub.c | 31 +++++++++++++++++++++++++++++++ hw/smbios/smbios.c | 2 +- include/hw/smbios/smbios.h | 2 +- include/sysemu/arch_init.h | 1 - vl.c | 2 +- 8 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 hw/smbios/smbios-stub.c -- 1.8.3.1 diff --git a/arch_init.c b/arch_init.c index 5cc58b2..34e7694 100644 --- a/arch_init.c +++ b/arch_init.c @@ -28,7 +28,6 @@ #include "sysemu/arch_init.h" #include "hw/pci/pci.h" #include "hw/audio/audio.h" -#include "hw/smbios/smbios.h" #include "qemu/config-file.h" #include "qemu/error-report.h" #include "qmp-commands.h" @@ -248,13 +247,6 @@ void do_acpitable_option(const QemuOpts *opts) #endif } -void do_smbios_option(QemuOpts *opts) -{ -#ifdef TARGET_I386 - smbios_entry_add(opts); -#endif -} - int kvm_available(void) { #ifdef CONFIG_KVM diff --git a/hw/Makefile.objs b/hw/Makefile.objs index 0ffd281..2a73ae5 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -33,7 +33,7 @@ devices-dirs-$(CONFIG_VIRTIO) += virtio/ devices-dirs-$(CONFIG_SOFTMMU) += watchdog/ devices-dirs-$(CONFIG_SOFTMMU) += xen/ devices-dirs-$(CONFIG_MEM_HOTPLUG) += mem/ -devices-dirs-$(CONFIG_SMBIOS) += smbios/ +devices-dirs-$(CONFIG_SOFTMMU) += smbios/ devices-dirs-y += core/ common-obj-y += $(devices-dirs-y) obj-y += $(devices-dirs-y) diff --git a/hw/smbios/Makefile.objs b/hw/smbios/Makefile.objs index c3d3753..ee0712b 100644 --- a/hw/smbios/Makefile.objs +++ b/hw/smbios/Makefile.objs @@ -1,2 +1,5 @@ common-obj-$(CONFIG_SMBIOS) += smbios.o common-obj-$(call land,$(CONFIG_SMBIOS),$(CONFIG_IPMI)) += smbios_type_38.o + +common-obj-$(call lnot,$(CONFIG_SMBIOS)) += smbios-stub.o +common-obj-$(CONFIG_ALL) += smbios-stub.o diff --git a/hw/smbios/smbios-stub.c b/hw/smbios/smbios-stub.c new file mode 100644 index 0000000..3087394 --- /dev/null +++ b/hw/smbios/smbios-stub.c @@ -0,0 +1,31 @@ +/* + * SMBIOS stubs for platforms that don't support SMBIOS. + * + * Copyright (c) 2010 Isaku Yamahata + * VA Linux Systems Japan K.K. + * Copyright (c) 2016 Leif Lindholm + * Linaro Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see . + */ + +#include "qemu/osdep.h" +#include "qapi/qmp/qerror.h" +#include "qmp-commands.h" +#include "hw/smbios/smbios.h" + +void smbios_entry_add(QemuOpts *opts, Error **errp) +{ + error_setg(errp, QERR_UNSUPPORTED); +} diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 3a96ced..1a5437a 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -882,7 +882,7 @@ static void save_opt(const char **dest, QemuOpts *opts, const char *name) } } -void smbios_entry_add(QemuOpts *opts) +void smbios_entry_add(QemuOpts *opts, Error **errp) { const char *val; diff --git a/include/hw/smbios/smbios.h b/include/hw/smbios/smbios.h index 1cd53cc..31e8d5f 100644 --- a/include/hw/smbios/smbios.h +++ b/include/hw/smbios/smbios.h @@ -257,7 +257,7 @@ struct smbios_type_127 { struct smbios_structure_header header; } QEMU_PACKED; -void smbios_entry_add(QemuOpts *opts); +void smbios_entry_add(QemuOpts *opts, Error **errp); void smbios_set_cpuid(uint32_t version, uint32_t features); void smbios_set_defaults(const char *manufacturer, const char *product, const char *version, bool legacy_mode, diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 1c9dad1..88dcf77 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -29,7 +29,6 @@ extern const uint32_t arch_type; void select_soundhw(const char *optarg); void do_acpitable_option(const QemuOpts *opts); -void do_smbios_option(QemuOpts *opts); void audio_init(void); int kvm_available(void); int xen_available(void); diff --git a/vl.c b/vl.c index a23de18..1b81340 100644 --- a/vl.c +++ b/vl.c @@ -3712,7 +3712,7 @@ int main(int argc, char **argv, char **envp) if (!opts) { exit(1); } - do_smbios_option(opts); + smbios_entry_add(opts, &error_fatal); break; case QEMU_OPTION_fwcfg: opts = qemu_opts_parse_noisily(qemu_find_opts("fw_cfg"),