diff options
author | Corey Minyard <cminyard@mvista.com> | 2015-12-17 12:50:12 -0600 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-12-22 18:39:19 +0200 |
commit | 90b6180500a9a88f194dc58c70b87dd539405f94 (patch) | |
tree | a086e1d96c6e5d7170a2350253d5b978beee7c79 /hw/ipmi | |
parent | bd66bcfca571433e7913a4ec1cdd5029d9de0287 (diff) |
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')
-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; +} |