diff options
author | Corey Minyard | 2015-12-17 19:50:12 +0100 |
---|---|---|
committer | Michael S. Tsirkin | 2015-12-22 17:39:19 +0100 |
commit | 90b6180500a9a88f194dc58c70b87dd539405f94 (patch) | |
tree | a086e1d96c6e5d7170a2350253d5b978beee7c79 /hw/ipmi/ipmi.c | |
parent | ipmi: Add migration capability to the IPMI devices. (diff) | |
download | qemu-90b6180500a9a88f194dc58c70b87dd539405f94.tar.gz qemu-90b6180500a9a88f194dc58c70b87dd539405f94.tar.xz qemu-90b6180500a9a88f194dc58c70b87dd539405f94.zip |
ipmi: Add a firmware configuration repository
Add a way for IPMI devices to register their firmware information
with the IPMI subsystem so that various firmware entities can pull
that information later for adding to firmware tables.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/ipmi/ipmi.c')
-rw-r--r-- | hw/ipmi/ipmi.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c index 7d174692aa..52aba1e20d 100644 --- a/hw/ipmi/ipmi.c +++ b/hw/ipmi/ipmi.c @@ -123,3 +123,30 @@ static void ipmi_register_types(void) } type_init(ipmi_register_types) + +static IPMIFwInfo *ipmi_fw_info; +static unsigned int ipmi_fw_info_len; + +static uint32_t current_uuid = 1; + +void ipmi_add_fwinfo(IPMIFwInfo *info, Error **errp) +{ + info->uuid = current_uuid++; + ipmi_fw_info = g_realloc(ipmi_fw_info, + sizeof(*ipmi_fw_info) * (ipmi_fw_info_len + 1)); + ipmi_fw_info[ipmi_fw_info_len] = *info; +} + +IPMIFwInfo *ipmi_first_fwinfo(void) +{ + return ipmi_fw_info; +} + +IPMIFwInfo *ipmi_next_fwinfo(IPMIFwInfo *current) +{ + current++; + if (current >= &ipmi_fw_info[ipmi_fw_info_len]) { + return NULL; + } + return current; +} |