]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/smbios: fix offset of type 3 sku field
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 15 Feb 2019 15:36:00 +0000 (15:36 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 22 Feb 2019 15:51:31 +0000 (10:51 -0500)
The type 3 SMBIOS structure[1] ends with fields

  ...
  0x14  - contained element count
  0x15  - contained element record length
  0x16  - sku number

The smbios_type_3 struct missed the contained element record
length field, causing sku number to be reported at the wrong
offset.

[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.1.1.pdf

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190215153600.1770727-1-berrange@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Fixes: e41fca3da72
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/smbios/smbios.c
include/hw/firmware/smbios.h

index 818be8a8388bcaa5f6635d6210a709284f7142fc..47be9071fa4fbf20d34b2482e80a8ffa21b78994 100644 (file)
@@ -563,6 +563,7 @@ static void smbios_build_type_3_table(void)
     t->height = 0;
     t->number_of_power_cords = 0;
     t->contained_element_count = 0;
+    t->contained_element_record_length = 0;
     SMBIOS_TABLE_SET_STR(3, sku_number_str, type3.sku);
 
     SMBIOS_BUILD_TABLE_POST;
index eeb5a4d7b669273b1d6802e605b872715aa2ee1e..6fef32a3c914c5c4dde1a801b842d8c48a6a404f 100644 (file)
@@ -162,6 +162,7 @@ struct smbios_type_3 {
     uint8_t height;
     uint8_t number_of_power_cords;
     uint8_t contained_element_count;
+    uint8_t contained_element_record_length;
     uint8_t sku_number_str;
     /* contained elements follow */
 } QEMU_PACKED;