aboutsummaryrefslogtreecommitdiffstats
path: root/vl.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-17 18:59:56 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-17 18:59:56 +0000
commitb6f6e3d3a71cee61320216a42940cfaa9b42a162 (patch)
tree43d740b55bcc447601eb4ee92e2936f0229c294e /vl.c
parentc4be29ff4376c4c519119e376ddd0c3c8e24af4e (diff)
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 <alex.williamson@hp.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index 1515e7af5..72ea0e40b 100644
--- a/vl.c
+++ b/vl.c
@@ -138,6 +138,7 @@ int main(int argc, char **argv)
#include "hw/isa.h"
#include "hw/baum.h"
#include "hw/bt.h"
+#include "hw/smbios.h"
#include "bt-host.h"
#include "net.h"
#include "monitor.h"
@@ -4214,6 +4215,10 @@ int qemu_uuid_parse(const char *str, uint8_t *uuid)
if(ret != 16)
return -1;
+#ifdef TARGET_I386
+ smbios_add_field(1, offsetof(struct smbios_type_1, uuid), 16, uuid);
+#endif
+
return 0;
}
@@ -4797,6 +4802,12 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
break;
+ case QEMU_OPTION_smbios:
+ if(smbios_entry_add(optarg) < 0) {
+ fprintf(stderr, "Wrong smbios provided\n");
+ exit(1);
+ }
+ break;
#endif
#ifdef USE_KQEMU
case QEMU_OPTION_no_kqemu: