qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

mach-virt: Set VM's SMBIOS system version to mc->name

Instead of using "1.0" as the system version of SMBIOS, we should use
mc->name for mach-virt machine type to be consistent other architectures.
With this patch, "dmidecode -t 1" (e.g., "-M virt-2.12,accel=kvm") will
show:

Handle 0x0100, DMI type 1, 27 bytes
System Information
Manufacturer: QEMU
Product Name: KVM Virtual Machine
Version: virt-2.12
Serial Number: Not Specified
...

instead of:

Handle 0x0100, DMI type 1, 27 bytes
System Information
Manufacturer: QEMU
Product Name: KVM Virtual Machine
Version: 1.0
Serial Number: Not Specified
...

For backward compatibility, we allow older machine types to keep "1.0"
as the default system version.

Signed-off-by: Wei Huang <wei@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 20180322212318.7182-1-wei@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

authored by

Wei Huang and committed by
Peter Maydell
dfadc3bf 478a573a

+8 -1
+7 -1
hw/arm/virt.c
··· 1132 1132 1133 1133 static void virt_build_smbios(VirtMachineState *vms) 1134 1134 { 1135 + MachineClass *mc = MACHINE_GET_CLASS(vms); 1136 + VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); 1135 1137 uint8_t *smbios_tables, *smbios_anchor; 1136 1138 size_t smbios_tables_len, smbios_anchor_len; 1137 1139 const char *product = "QEMU Virtual Machine"; ··· 1145 1147 } 1146 1148 1147 1149 smbios_set_defaults("QEMU", product, 1148 - "1.0", false, true, SMBIOS_ENTRY_POINT_30); 1150 + vmc->smbios_old_sys_ver ? "1.0" : mc->name, false, 1151 + true, SMBIOS_ENTRY_POINT_30); 1149 1152 1150 1153 smbios_get_tables(NULL, 0, &smbios_tables, &smbios_tables_len, 1151 1154 &smbios_anchor, &smbios_anchor_len); ··· 1646 1649 1647 1650 static void virt_machine_2_11_options(MachineClass *mc) 1648 1651 { 1652 + VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); 1653 + 1649 1654 virt_machine_2_12_options(mc); 1650 1655 SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_11); 1656 + vmc->smbios_old_sys_ver = true; 1651 1657 } 1652 1658 DEFINE_VIRT_MACHINE(2, 11) 1653 1659
+1
include/hw/arm/virt.h
··· 85 85 bool no_its; 86 86 bool no_pmu; 87 87 bool claim_edge_triggered_timers; 88 + bool smbios_old_sys_ver; 88 89 } VirtMachineClass; 89 90 90 91 typedef struct {