• Markus Armbruster's avatar
    smbios: Make multiple -smbios type= accumulate sanely · fc3b3295
    Markus Armbruster authored
    Currently, -smbios type=T,NAME=VAL,... adds one field (T,NAME) with
    value VAL to fw_cfg for each unique NAME.  If NAME occurs multiple
    times, the last one's VAL is used (before the QemuOpts conversion, the
    first one was used).
    
    Multiple -smbios can add multiple fields with the same (T, NAME).
    SeaBIOS reads all of them from fw_cfg, but uses only the first field
    (T, NAME).  The others are ignored.
    
    "First one wins, subsequent ones get ignored silently" isn't nice.  We
    commonly let the last option win.  Useful, because it lets you
    -readconfig first, then selectively override with command line
    options.
    
    Clean up -smbios to work the common way.  Accumulate the settings,
    with later ones overwriting earlier ones.  Put the result into fw_cfg
    (no more useless duplicates).
    
    Bonus cleanup: qemu_uuid_parse() no longer sets SMBIOS system uuid by
    side effect.
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    fc3b3295
arch_init.c 32.9 KB