From fc3b32958a80bca13309e2695de07b43dd788421 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 16 Aug 2013 15:18:31 +0200 Subject: smbios: Make multiple -smbios type= accumulate sanely 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: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Michael S. Tsirkin --- include/sysemu/sysemu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sysemu') diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index b1aa059102..42577363ca 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -16,6 +16,7 @@ extern const char *bios_name; extern const char *qemu_name; extern uint8_t qemu_uuid[]; +extern bool qemu_uuid_set; int qemu_uuid_parse(const char *str, uint8_t *uuid); #define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx" -- cgit v1.2.1