Introduce the hw/firmware/ namespace
v2 cover Introduce the hw/firmware/ namespace
Hi,
QEMU interacts with various firmwares. We already have some helpers for some firmwares. Later we will add UEFI helpers.
This series introduce the hw/firmware namespace for this.
There is no need to move hw/smbios sources into a specific directory, we only focus on the headers.
Since v1 https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg01585.html:
- Addressed Laszlo's comments
- Added R-b (Michael, Corey, Laszlo)
Philippe Mathieu-Daudé (4):
tests: Remove unused include
hw/smbios: Restrict access to "hw/smbios/ipmi.h" hw/smbios: Remove "smbios_ipmi.h" hw/smbios: Move to the hw/firmware/ subdirectory
MAINTAINERS | 2 +-
hw/arm/virt.c | 2 +-
hw/i386/pc.c | 2 +-
hw/i386/pc_piix.c | 2 +-
hw/i386/pc_q35.c | 2 +-
hw/smbios/smbios-stub.c | 2 +-
hw/smbios/smbios.c | 3 +--
hw/smbios/smbios_build.h | 4 ++++
hw/smbios/smbios_type_38-stub.c | 2 +-
hw/smbios/smbios_type_38.c | 3 +--
include/hw/{smbios => firmware}/smbios.h | 0
include/hw/smbios/ipmi.h | 15 ---------------
tests/acpi-utils.c | 1 -
tests/bios-tables-test.c | 2 +-
vl.c | 2 +-
15 files changed, 15 insertions(+), 29 deletions(-)
rename include/hw/{smbios => firmware}/smbios.h (100%)
delete mode 100644 include/hw/smbios/ipmi.hSignature · 1 line
2.17.2
PATCH v2 1/4 tests: Remove unused include
The "hw/smbios/smbios.h" include is not used, remove it.
--- tests/acpi-utils.c | 1 - 1 file changed, 1 deletion(-)
tests/acpi-utils.c +0 -1
@@ -15,7 +15,6 @@#include "qemu/osdep.h" #include <glib/gstdio.h> #include "qemu-common.h" -#include "hw/smbios/smbios.h" #include "qemu/bitmap.h" #include "acpi-utils.h" #include "boot-sector.h"
Signature · 1 line
2.17.2
PATCH v2 2/4 hw/smbios: Restrict access to "hw/smbios/ipmi.h"
In reply to Philippe Mathieu-DaudéAll the consumers of "hw/smbios/ipmi.h" are located in hw/smbios/. There is no need to have this include publicly exposed, reduce the visibility by moving it in hw/smbios/.
--- hw/smbios/smbios.c | 2 +- include/hw/smbios/ipmi.h => hw/smbios/smbios_ipmi.h | 0 hw/smbios/smbios_type_38-stub.c | 2 +- hw/smbios/smbios_type_38.c | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename include/hw/smbios/ipmi.h => hw/smbios/smbios_ipmi.h (100%)
hw/smbios/smbios.c +1 -1
@@ -28,7 +28,7 @@#include "hw/loader.h" #include "exec/cpu-common.h" #include "smbios_build.h" -#include "hw/smbios/ipmi.h" +#include "smbios_ipmi.h" /* legacy structures and constants for <= 2.0 machines */ struct smbios_header {
hw/smbios/smbios_ipmi.h renamed from include/hw/smbios/ipmi.h +0 -0
hw/smbios/smbios_type_38-stub.c +1 -1
@@ -8,7 +8,7 @@*/ #include "qemu/osdep.h" -#include "hw/smbios/ipmi.h" +#include "smbios_ipmi.h" void smbios_build_type_38_table (void ) {
hw/smbios/smbios_type_38.c +1 -1
@@ -9,10 +9,10 @@#include "qemu/osdep.h" #include "hw/ipmi/ipmi.h" -#include "hw/smbios/ipmi.h" #include "hw/smbios/smbios.h" #include "qemu/error-report.h" #include "smbios_build.h" +#include "smbios_ipmi.h" /* SMBIOS type 38 - IPMI */ struct smbios_type_38 {
Signature · 1 line
2.17.2
PATCH v2 3/4 hw/smbios: Remove "smbios_ipmi.h"
In reply to Philippe Mathieu-DaudéThis header only declare a single function: smbios_build_type_38_table(). We already have a header that declares such functions: "smbios_build.h". Move the declaration and remove the header.
--- hw/smbios/smbios.c | 1 - hw/smbios/smbios_build.h | 4 ++++ hw/smbios/smbios_ipmi.h | 15 --------------- hw/smbios/smbios_type_38-stub.c | 2 +- hw/smbios/smbios_type_38.c | 1 - 5 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 hw/smbios/smbios_ipmi.h
hw/smbios/smbios.c +0 -1
@@ -28,7 +28,6 @@#include "hw/loader.h" #include "exec/cpu-common.h" #include "smbios_build.h" -#include "smbios_ipmi.h" /* legacy structures and constants for <= 2.0 machines */ struct smbios_header {
hw/smbios/smbios_build.h +4 -0
@@ -3,6 +3,7 @@* * Copyright (C) 2009 Hewlett-Packard Development Company, L.P. * Copyright (C) 2013 Red Hat, Inc. +* Copyright (c) 2015,2016 Corey Minyard, MontaVista Software, LLC * * Authors: * Alex Williamson <[email protected]>
@@ -96,4 +97,7 @@ extern unsigned smbios_table_cnt; smbios_table_cnt++; \ } while (0) +/* IPMI SMBIOS firmware handling */ +void smbios_build_type_38_table(void); +#endif /* QEMU_SMBIOS_BUILD_H */
hw/smbios/smbios_ipmi.h deleted +0 -15
@@ -1,15 +0,0 @@ -/* -* IPMI SMBIOS firmware handling -* -* Copyright (c) 2015,2016 Corey Minyard, MontaVista Software, LLC -* -* This work is licensed under the terms of the GNU GPL, version 2 or later. -* See the COPYING file in the top-level directory. -*/ - -#ifndef QEMU_SMBIOS_IPMI_H -#define QEMU_SMBIOS_IPMI_H - -void smbios_build_type_38_table (void ); - -#endif /* QEMU_SMBIOS_IPMI_H */
hw/smbios/smbios_type_38-stub.c +1 -1
@@ -8,7 +8,7 @@*/ #include "qemu/osdep.h" -#include "smbios_ipmi.h" +#include "smbios_build.h" void smbios_build_type_38_table (void ) {
hw/smbios/smbios_type_38.c +0 -1
@@ -12,7 +12,6 @@#include "hw/smbios/smbios.h" #include "qemu/error-report.h" #include "smbios_build.h" -#include "smbios_ipmi.h" /* SMBIOS type 38 - IPMI */ struct smbios_type_38 {
Signature · 1 line
2.17.2
PATCH v2 4/4 hw/smbios: Move to the hw/firmware/ subdirectory
In reply to Philippe Mathieu-DaudéSMBIOS is just another firmware interface used by some QEMU models. We will later introduce more firmware interfaces in this subdirectory.
---
MAINTAINERS | 2 +-
hw/arm/virt.c | 2 +-
hw/i386/pc.c | 2 +-
hw/i386/pc_piix.c | 2 +-
hw/i386/pc_q35.c | 2 +-
hw/smbios/smbios-stub.c | 2 +-
hw/smbios/smbios.c | 2 +-
hw/smbios/smbios_type_38.c | 2 +-
include/hw/{smbios => firmware}/smbios.h | 0
tests/bios-tables-test.c | 2 +-
vl.c | 2 +-
11 files changed, 10 insertions(+), 10 deletions(-)
rename include/hw/{smbios => firmware}/smbios.h (100%)MAINTAINERS +1 -1
@@ -1238,7 +1238,7 @@ M: Michael S. Tsirkin <[email protected]> M: Igor Mammedov <[email protected]> S: Supported F: include/hw/acpi/* -F: include/hw/smbios/* +F: include/hw/firmware/smbios.h F: hw/mem/* F: hw/acpi/* F: hw/smbios/*
hw/arm/virt.c +1 -1
@@ -55,7 +55,7 @@#include "hw/intc/arm_gic.h" #include "hw/intc/arm_gicv3_common.h" #include "kvm_arm.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "qapi/visitor.h" #include "standard-headers/linux/input.h" #include "hw/arm/smmuv3.h"
hw/i386/pc.c +1 -1
@@ -37,7 +37,7 @@#include "hw/pci/pci_bus.h" #include "hw/nvram/fw_cfg.h" #include "hw/timer/hpet.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "hw/loader.h" #include "elf.h" #include "multiboot.h"
hw/i386/pc_piix.c +1 -1
@@ -30,7 +30,7 @@#include "hw/i386/pc.h" #include "hw/i386/apic.h" #include "hw/display/ramfb.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "hw/pci/pci.h" #include "hw/pci/pci_ids.h" #include "hw/usb.h"
hw/i386/pc_q35.c +1 -1
@@ -47,7 +47,7 @@#include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" #include "hw/display/ramfb.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "hw/ide/pci.h" #include "hw/ide/ahci.h" #include "hw/usb.h"
hw/smbios/smbios-stub.c +1 -1
@@ -23,7 +23,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" void smbios_entry_add (QemuOpts *opts,Error **errp) {
hw/smbios/smbios.c +1 -1
@@ -24,7 +24,7 @@#include "sysemu/sysemu.h" #include "qemu/uuid.h" #include "sysemu/cpus.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "hw/loader.h" #include "exec/cpu-common.h" #include "smbios_build.h"
hw/smbios/smbios_type_38.c +1 -1
@@ -9,7 +9,7 @@#include "qemu/osdep.h" #include "hw/ipmi/ipmi.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "qemu/error-report.h" #include "smbios_build.h"
include/hw/firmware/smbios.h renamed from include/hw/smbios/smbios.h +0 -0
tests/bios-tables-test.c +1 -1
@@ -13,7 +13,7 @@#include "qemu/osdep.h" #include <glib/gstdio.h> #include "qemu-common.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "qemu/bitmap.h" #include "acpi-utils.h" #include "boot-sector.h"
vl.c +1 -1
@@ -61,7 +61,7 @@ int main(int argc, char **argv)#include "hw/display/vga.h" #include "hw/bt.h" #include "sysemu/watchdog.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "hw/acpi/acpi.h" #include "hw/xen/xen.h" #include "hw/qdev.h"
Signature · 1 line
2.17.2