qemu: Add support for SMBIOS command line otions (Alex Williamson)

Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.

Binary SMBIOS entries can be generated as follows:

dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
        perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin

These can then be passed to the BIOS using this switch:

 -smbios file=smbios_type_1.bin

Command line generation supports the following syntax:

 -smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
 -smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
              [,uuid=$(uuidgen)][,sku=str][,family=str]

For instance, to add a serial number to the type 1 table:

 -smbios type=1,serial=0123456789

Interface is extensible to support more fields/tables as needed.

aliguori: remove texi formatting from help output

Signed-off-by: Alex Williamson <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/qemu-options.hx b/qemu-options.hx
index f551775..4d15f9b 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -683,6 +683,27 @@
 ETEXI
 
 #ifdef TARGET_I386
+DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
+    "-smbios file=binary\n"
+    "                Load SMBIOS entry from binary file\n"
+    "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%%d.%%d]\n"
+    "                Specify SMBIOS type 0 fields\n"
+    "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
+    "              [,uuid=uuid][,sku=str][,family=str]\n"
+    "                Specify SMBIOS type 1 fields\n")
+#endif
+STEXI
+@item -smbios file=@var{binary}
+Load SMBIOS entry from binary file.
+
+@item -smbios type=0[,vendor=@var{str}][,version=@var{str}][,date=@var{str}][,release=@var{%d.%d}]
+Specify SMBIOS type 0 fields
+
+@item -smbios type=1[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,uuid=@var{uuid}][,sku=@var{str}][,family=@var{str}]
+Specify SMBIOS type 1 fields
+ETEXI
+
+#ifdef TARGET_I386
 DEFHEADING()
 #endif
 STEXI