SMBIOS: Use bitmaps to prevent incompatible comand line options

Replace existing smbios_check_collision() functionality with
a pair of bitmaps: have_binfile_bitmap and have_fields_bitmap.
Bits corresponding to each smbios type are set by smbios_entry_add(),
which also uses the bitmaps to ensure that binary blobs and field
values are never accepted for the same type.

These bitmaps will also be used in the future to decide whether
or not to build a full table for a given smbios type.

Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gabriel L. Somlo 2014-04-23 09:42:41 -04:00 committed by Gerd Hoffmann
parent cb36acb672
commit 2e6e8d7a25
2 changed files with 22 additions and 30 deletions

View file

@ -15,6 +15,8 @@
#include "qemu/option.h"
#define SMBIOS_MAX_TYPE 127
void smbios_entry_add(QemuOpts *opts);
void smbios_set_defaults(const char *manufacturer, const char *product,
const char *version);