Skip to contentSkip to conversation

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

PATCH In review Wei Huang 4 participants 6 messages Sep 22, 2017 – Sep 27, 2017

lore
Share & tools
lore

Wei Huang

author
#0 lore raw

PATCH 1/1 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. This matches with x86 code and prevents the smbios_table.machine_type test of Avocado from failing.

---
 hw/arm/virt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/arm/virt.c +2 -1
index 9e18b41..8d0c6a9 100644
@@ -1189,6 +1189,7 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size)
 
 static void virt_build_smbios(VirtMachineState *vms)
 {
+    MachineClass *mc = MACHINE_GET_CLASS(vms);
     uint8_t *smbios_tables, *smbios_anchor;
     size_t smbios_tables_len, smbios_anchor_len;
     const char *product = "QEMU Virtual Machine";
@@ -1202,7 +1203,7 @@ static void virt_build_smbios(VirtMachineState *vms)
     }
 
     smbios_set_defaults("QEMU", product,
-                        "1.0", false, true, SMBIOS_ENTRY_POINT_30);
+                        mc->name, false, true, SMBIOS_ENTRY_POINT_30);
 
     smbios_get_tables(NULL, 0, &smbios_tables, &smbios_tables_len,
                       &smbios_anchor, &smbios_anchor_len);
Signature · 1 line
2.7.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 34 lines · Wei Huang

Instead of using "1.0" as the system version of SMBIOS, we should use mc->name for mach-virt machine type. This matches with x86 code and prevents the smbios_table.machine_type test of Avocado from failing.

---
 hw/arm/virt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/arm/virt.c +2 -1
index 9e18b41..8d0c6a9 100644
@@ -1189,6 +1189,7 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size)
 
 static void virt_build_smbios(VirtMachineState *vms)
 {
+    MachineClass *mc = MACHINE_GET_CLASS(vms);
     uint8_t *smbios_tables, *smbios_anchor;
     size_t smbios_tables_len, smbios_anchor_len;
     const char *product = "QEMU Virtual Machine";
@@ -1202,7 +1203,7 @@ static void virt_build_smbios(VirtMachineState *vms)
     }
 
     smbios_set_defaults("QEMU", product,
-                        "1.0", false, true, SMBIOS_ENTRY_POINT_30);
+                        mc->name, false, true, SMBIOS_ENTRY_POINT_30);
 
     smbios_get_tables(NULL, 0, &smbios_tables, &smbios_tables_len,
                       &smbios_anchor, &smbios_anchor_len);
Signature · 1 line
2.7.5
#2 lore raw
Quoted 29 lines · Andrew Jones
Quoted 28 lines · Wei Huang

Instead of using "1.0" as the system version of SMBIOS, we should use mc->name for mach-virt machine type. This matches with x86 code and prevents the smbios_table.machine_type test of Avocado from failing.

---
 hw/arm/virt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/arm/virt.c +2 -1
index 9e18b41..8d0c6a9 100644
@@ -1189,6 +1189,7 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size)
 
 static void virt_build_smbios(VirtMachineState *vms)
 {
+    MachineClass *mc = MACHINE_GET_CLASS(vms);
     uint8_t *smbios_tables, *smbios_anchor;
     size_t smbios_tables_len, smbios_anchor_len;
     const char *product = "QEMU Virtual Machine";
@@ -1202,7 +1203,7 @@ static void virt_build_smbios(VirtMachineState *vms)
     }
 
     smbios_set_defaults("QEMU", product,
-                        "1.0", false, true, SMBIOS_ENTRY_POINT_30);
+                        mc->name, false, true, SMBIOS_ENTRY_POINT_30);
 
Quoted 8 lines
Quoted 6 lines
hw/arm/virt.c +0 -1
     smbios_get_tables(NULL, 0, &smbios_tables, &smbios_tables_len,
                       &smbios_anchor, &smbios_anchor_len);
--

2.7.5

Are we OK to change this without having to tie it to the machine version number?

thanks
-- PMM

#3 lore raw
Quoted 39 lines · Peter Maydell
Quoted 29 lines · Andrew Jones
Quoted 28 lines · Wei Huang

Instead of using "1.0" as the system version of SMBIOS, we should use mc->name for mach-virt machine type. This matches with x86 code and prevents the smbios_table.machine_type test of Avocado from failing.

---
 hw/arm/virt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/arm/virt.c +2 -1
index 9e18b41..8d0c6a9 100644
@@ -1189,6 +1189,7 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size)
 
 static void virt_build_smbios(VirtMachineState *vms)
 {
+    MachineClass *mc = MACHINE_GET_CLASS(vms);
     uint8_t *smbios_tables, *smbios_anchor;
     size_t smbios_tables_len, smbios_anchor_len;
     const char *product = "QEMU Virtual Machine";
@@ -1202,7 +1203,7 @@ static void virt_build_smbios(VirtMachineState *vms)
     }
 
     smbios_set_defaults("QEMU", product,
-                        "1.0", false, true, SMBIOS_ENTRY_POINT_30);
+                        mc->name, false, true, SMBIOS_ENTRY_POINT_30);
 
Quoted 8 lines
Quoted 6 lines
hw/arm/virt.c +0 -1
     smbios_get_tables(NULL, 0, &smbios_tables, &smbios_tables_len,
                       &smbios_anchor, &smbios_anchor_len);
--

2.7.5

Quoted 2 lines

Are we OK to change this without having to tie it to the machine version number?

Let's tie it to be safe. Eric has a 2.11 machine version patch in his virtio-iommu series, but, like for 2.10, he or Wei should probably just post that independently to make sure it gets in.

Wei, will you post the 2.11 version patch?

Thanks,
drew

author
#4 lore raw
Quoted 40 lines · Andrew Jones
Quoted 39 lines · Peter Maydell
Quoted 37 lines · Andrew Jones
Quoted 31 lines · Wei Huang

Instead of using "1.0" as the system version of SMBIOS, we should use mc->name for mach-virt machine type. This matches with x86 code and prevents the smbios_table.machine_type test of Avocado from failing.

---
 hw/arm/virt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/arm/virt.c +2 -2
index 9e18b41..8d0c6a9 100644
@@ -1189,6 +1189,7 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size)
 
 static void virt_build_smbios(VirtMachineState *vms)
 {
+    MachineClass *mc = MACHINE_GET_CLASS(vms);
     uint8_t *smbios_tables, *smbios_anchor;
     size_t smbios_tables_len, smbios_anchor_len;
     const char *product = "QEMU Virtual Machine";
@@ -1202,7 +1203,7 @@ static void virt_build_smbios(VirtMachineState *vms)
     }
 
     smbios_set_defaults("QEMU", product,
-                        "1.0", false, true, SMBIOS_ENTRY_POINT_30);
+                        mc->name, false, true, SMBIOS_ENTRY_POINT_30);
 
     smbios_get_tables(NULL, 0, &smbios_tables, &smbios_tables_len,
                       &smbios_anchor, &smbios_anchor_len);
--
Quoted 3 lines

2.7.5

Quoted 8 lines
Quoted 2 lines

Are we OK to change this without having to tie it to the machine version number?

Let's tie it to be safe. Eric has a 2.11 machine version patch in his virtio-iommu series, but, like for 2.10, he or Wei should probably just post that independently to make sure it gets in.

Wei, will you post the 2.11 version patch?

Will do

Quoted 4 lines

Thanks,
drew

#5 lore raw

Hi Wei,

Quoted 46 lines · Wei Huang
Quoted 43 lines · Andrew Jones
Quoted 41 lines · Peter Maydell
Quoted 29 lines · Andrew Jones
Quoted 28 lines · Wei Huang

Instead of using "1.0" as the system version of SMBIOS, we should use mc->name for mach-virt machine type. This matches with x86 code and prevents the smbios_table.machine_type test of Avocado from failing.

---
 hw/arm/virt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/arm/virt.c +2 -1
index 9e18b41..8d0c6a9 100644
@@ -1189,6 +1189,7 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size)
 
 static void virt_build_smbios(VirtMachineState *vms)
 {
+    MachineClass *mc = MACHINE_GET_CLASS(vms);
     uint8_t *smbios_tables, *smbios_anchor;
     size_t smbios_tables_len, smbios_anchor_len;
     const char *product = "QEMU Virtual Machine";
@@ -1202,7 +1203,7 @@ static void virt_build_smbios(VirtMachineState *vms)
     }
 
     smbios_set_defaults("QEMU", product,
-                        "1.0", false, true, SMBIOS_ENTRY_POINT_30);
+                        mc->name, false, true, SMBIOS_ENTRY_POINT_30);
 
Quoted 8 lines
Quoted 6 lines
hw/arm/virt.c +0 -1
     smbios_get_tables(NULL, 0, &smbios_tables, &smbios_tables_len,
                       &smbios_anchor, &smbios_anchor_len);
--

2.7.5

Are we OK to change this without having to tie it to the machine version number?

Quoted 7 lines
Quoted 5 lines

Let's tie it to be safe. Eric has a 2.11 machine version patch in his virtio-iommu series, but, like for 2.10, he or Wei should probably just post that independently to make sure it gets in.

Wei, will you post the 2.11 version patch?

Will do

yep, feel free to reuse my patch and remove the noiommu field.

Thanks

Eric

Quoted 6 lines
Quoted 5 lines

Thanks,
drew