The implementation for this is very hacky.
For non-legacy smbios we need to deconstruct a packed smbios table that qemu supplies. Preferably around this code in smbios_romfile_setup(void):
/* did we get a type 0 structure ? */ for (t0 = smbios_next(&ep, NULL); t0; t0 = smbios_next(&ep, t0)) if (t0->header.type == 0) { need_t0 = 0; break; }
We need to do some smbios tables math to find the correct date string.
For legacy smbios we can read the fw_cfg that supplies the date, just like get_field() does, ignoring the unused case for get_external() which may also require deconstructing a packed smbios table table.
This will not look good.
I think using a simple fw_cfg value for this task has the following advantages: Makes less changes in the current flow Only enabled by “power users” that know what they are doing, otherwise nothing changes Detaches smbios date from the date that is reported via SystemBiosDate (So we can now support cases that require different values to be reported that way) Makes the SystemBiosDate behavior more explicit
WDYT?
Sam
On 29 May 2019, at 9:49, Gerd Hoffmann kraxel@redhat.com wrote:
On Wed, May 29, 2019 at 09:39:05AM +0300, Sam Eiderman wrote:
So what do you suggest?
If qemu supplies a date in legacy/non-legacy we override the date in FSEG(0xfff5) with it
I think that makes sense, yes.
cheers, Gerd