diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2014-10-29 11:26:08 -0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-11-02 13:44:52 +0200 |
commit | caad057bb6ce86a9cb71520af395fd0bd04a659f (patch) | |
tree | 9b26db555e09f85d22fd934e334769d124fb2997 /hw/i386/pc_q35.c | |
parent | 2cad57c7177766e2779f30fed9e4578bc7ad62ac (diff) | |
download | qemu-caad057bb6ce86a9cb71520af395fd0bd04a659f.zip qemu-caad057bb6ce86a9cb71520af395fd0bd04a659f.tar.gz qemu-caad057bb6ce86a9cb71520af395fd0bd04a659f.tar.bz2 |
smbios: Encode UUID according to SMBIOS specification
Differently from older versions, SMBIOS version 2.6 is explicit about
the encoding of UUID fields:
> Although RFC 4122 recommends network byte order for all fields, the PC
> industry (including the ACPI, UEFI, and Microsoft specifications) has
> consistently used little-endian byte encoding for the first three fields:
> time_low, time_mid, time_hi_and_version. The same encoding, also known as
> wire format, should also be used for the SMBIOS representation of the UUID.
>
> The UUID {00112233-4455-6677-8899-AABBCCDDEEFF} would thus be represented
> as 33 22 11 00 55 44 77 66 88 99 AA BB CC DD EE FF.
The dmidecode tool implements this and decodes the above "wire format"
when SMBIOS version >= 2.6. We moved from SMBIOS version 2.4 to 2.8 when
we started building the SMBIOS entry point inside QEMU, on commit
c97294ec1b9e36887e119589d456557d72ab37b5.
Change smbios_build_type_1_table() to encode the UUID as specified.
To make sure we won't change the guest-visible UUID when upgrading to a
newer QEMU version, keep the old behavior on pc-*-2.1 and older.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386/pc_q35.c')
-rw-r--r-- | hw/i386/pc_q35.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index aef4628..f69e4a1 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -52,6 +52,7 @@ static bool has_acpi_build = true; static bool smbios_defaults = true; static bool smbios_legacy_mode; +static bool smbios_uuid_encoded = true; /* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to * host addresses aligned at 1Gbyte boundaries. This way we can use 1GByte * pages in the host. @@ -163,7 +164,7 @@ static void pc_q35_init(MachineState *machine) MachineClass *mc = MACHINE_GET_CLASS(machine); /* These values are guest ABI, do not change */ smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)", - mc->name, smbios_legacy_mode); + mc->name, smbios_legacy_mode, smbios_uuid_encoded); } /* allocate ram and load rom/bios */ @@ -283,6 +284,7 @@ static void pc_q35_init(MachineState *machine) static void pc_compat_2_1(MachineState *machine) { + smbios_uuid_encoded = false; } static void pc_compat_2_0(MachineState *machine) |