Commit 1007a37e authored by Leif Lindholm's avatar Leif Lindholm Committed by Paolo Bonzini
Browse files

smbios: filter based on CONFIG_SMBIOS rather than TARGET



-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: default avatarLeif Lindholm <leif.lindholm@linaro.org>
Message-Id: <20161222151828.28292-1-leif.lindholm@linaro.org>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 1c6d75d5
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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)
+3 −0
Original line number Diff line number Diff line
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
+31 −0
Original line number Diff line number Diff line
/*
 * SMBIOS stubs for platforms that don't support SMBIOS.
 *
 * Copyright (c) 2010 Isaku Yamahata <yamahata at valinux co jp>
 *                    VA Linux Systems Japan K.K.
 * Copyright (c) 2016 Leif Lindholm <leif.lindholm@linaro.org>
 *                    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 <http://www.gnu.org/licenses/>.
 */

#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);
}
+1 −1
Original line number Diff line number Diff line
@@ -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;

Loading