]> Git Repo - qemu.git/commitdiff
smbios: implement smbios support for mach-virt
authorWei Huang <[email protected]>
Mon, 7 Sep 2015 09:39:29 +0000 (10:39 +0100)
committerPeter Maydell <[email protected]>
Mon, 7 Sep 2015 09:39:29 +0000 (10:39 +0100)
This patch generates smbios tables for ARM mach-virt. Also add
CONFIG_SMBIOS=y for ARM default config.

Acked-by: Gabriel Somlo <[email protected]>
Tested-by: Gabriel Somlo <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Shannon Zhao <[email protected]>
Tested-by: Leif Lindholm <[email protected]>
Signed-off-by: Wei Huang <[email protected]>
Message-id: 1440615870[email protected]
[PMM: Added missing braces around an if().]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
default-configs/arm-softmmu.mak
hw/arm/virt.c
qemu-options.hx

index 74f1db3a0af18f43b945324a04e39d00f4b512dc..99b41e979ee883e79321ea9f11878e9fb8de59b2 100644 (file)
@@ -102,3 +102,4 @@ CONFIG_XIO3130=y
 CONFIG_IOH3420=y
 CONFIG_I82801B11=y
 CONFIG_ACPI=y
+CONFIG_SMBIOS=y
index d5a84175c91de8af97c52488dbe00f596e750390..bbd061b9b662f339b61071b1a8689d07beae8fca 100644 (file)
@@ -50,6 +50,7 @@
 #include "hw/arm/fdt.h"
 #include "hw/intc/arm_gic_common.h"
 #include "kvm_arm.h"
+#include "hw/smbios/smbios.h"
 
 /* Number of external interrupt lines to configure the GIC with */
 #define NUM_IRQS 256
@@ -788,12 +789,37 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size)
     return board->fdt;
 }
 
+static void virt_build_smbios(VirtGuestInfo *guest_info)
+{
+    FWCfgState *fw_cfg = guest_info->fw_cfg;
+    uint8_t *smbios_tables, *smbios_anchor;
+    size_t smbios_tables_len, smbios_anchor_len;
+
+    if (!fw_cfg) {
+        return;
+    }
+
+    smbios_set_defaults("QEMU", "QEMU Virtual Machine",
+                        "1.0", false, true, SMBIOS_ENTRY_POINT_30);
+
+    smbios_get_tables(NULL, 0, &smbios_tables, &smbios_tables_len,
+                      &smbios_anchor, &smbios_anchor_len);
+
+    if (smbios_anchor) {
+        fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-tables",
+                        smbios_tables, smbios_tables_len);
+        fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor",
+                        smbios_anchor, smbios_anchor_len);
+    }
+}
+
 static
 void virt_guest_info_machine_done(Notifier *notifier, void *data)
 {
     VirtGuestInfoState *guest_info_state = container_of(notifier,
                                               VirtGuestInfoState, machine_done);
     virt_acpi_setup(&guest_info_state->info);
+    virt_build_smbios(&guest_info_state->info);
 }
 
 static void machvirt_init(MachineState *machine)
index 77f5853d53d9dd6ccf7c7b6fb45b7940ac710a37..efce775f667d3cd750eec5879fefcf9c7e792b2d 100644 (file)
@@ -1412,7 +1412,7 @@ DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
     "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
     "               [,asset=str][,part=str][,speed=%d]\n"
     "                specify SMBIOS type 17 fields\n",
-    QEMU_ARCH_I386)
+    QEMU_ARCH_I386 | QEMU_ARCH_ARM)
 STEXI
 @item -smbios file=@var{binary}
 @findex -smbios
This page took 0.029792 seconds and 4 git commands to generate.