summaryrefslogtreecommitdiff
path: root/hw/i386/smbios.c
AgeCommit message (Collapse)AuthorFilesLines
2013-12-10smbios: Set system manufacturer, product & version by defaultMarkus Armbruster1-0/+14
Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults: manufacturer QEMU, product & version taken from QEMUMachine desc and name. Take care to do this only for new machine types, of course. Note: Michael Tsirkin doesn't trust us to keep values of QEMUMachine member product stable in the future. Use copies instead, and in a way that makes it obvious that they're guest ABI. Note that we can be trusted to keep values of member name, because that has always been ABI. Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-09-28smbios: Factor out smbios_maybe_add_str()Markus Armbruster1-36/+25
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-09-28smbios: Make multiple -smbios type= accumulate sanelyMarkus Armbruster1-61/+91
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 <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-09-28smbios: Improve diagnostics for conflicting entriesMarkus Armbruster1-26/+17
We allow either tables or fields for the same type. Makes sense, because SeaBIOS uses fields only when no tables are present. We do this by searching the SMBIOS blob for a previously added table or field. Error messages look like this: qemu-system-x86_64: -smbios type=1,serial=42: SMBIOS type 1 table already defined, cannot add field User needs to know that "table" is defined by -smbios file=..., and "field" by -smbios type=... Instead of searching the blob, record additions of interest, and check that. Simpler, and makes better error messages possible: qemu-system-x86_64: -smbios file=smbios_type_1.bin: Can't mix file= and type= for same type qemu-system-x86_64: -smbios type=1,serial=42,serial=99: This is the conflicting setting Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-09-28smbios: Convert to QemuOptsMarkus Armbruster1-38/+171
So that it can be set in config file for -readconfig. This tightens parsing of -smbios, and makes it more consistent with other options: unknown parameters are rejected, numbers with trailing junk are rejected, when a parameter is given multiple times, last rather than first wins, ... MST: drop one chunk to fix build errors Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-09-28smbios: Normalize smbios_entry_add()'s error handling to exit(1)Markus Armbruster1-5/+5
It exits on all error conditions but one, where it returns -1. Normalize, and return void. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-06-14smbios: Check R in -smbios type=0, release=R parses okayMarkus Armbruster1-1/+4
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Laszlo "ever the optimist" Ersek <lersek@redhat.com> Message-id: 1370610036-10577-7-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-06-14smbios: Fix -smbios type=0, release=... for big endian hostsMarkus Armbruster1-2/+2
Classic endianness bug due to careless dirty coding: assuming reading a byte from an int variable gets the least significant byte. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Laszlo "ever the optimist" Ersek <lersek@redhat.com> Message-id: 1370610036-10577-6-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-06-14smbios: Clean up smbios_add_field() parametersMarkus Armbruster1-12/+14
Having size precede the associated pointer is odd. Swap them, and fix up the types. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Laszlo "ever the optimist" Ersek <lersek@redhat.com> Message-id: 1370610036-10577-5-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-06-14smbios: Convert to error_report()Markus Armbruster1-12/+12
Improves diagnistics from ad hoc messages like Invalid SMBIOS UUID string to qemu-system-x86_64: -smbios type=1,uuid=gaga: Invalid UUID Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Laszlo "ever the optimist" Ersek <lersek@redhat.com> Message-id: 1370610036-10577-4-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-08hw: move headers to include/Paolo Bonzini1-1/+1
Many of these should be cleaned up with proper qdev-/QOM-ification. Right now there are many catch-all headers in include/hw/ARCH depending on cpu.h, and this makes it necessary to compile these files per-target. However, fixing this does not belong in these patches. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-03-01hw: move boards and other isolated files to hw/ARCHPaolo Bonzini1-0/+241
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>