summaryrefslogtreecommitdiffstats
path: root/hw/ipmi/ipmi.c
diff options
context:
space:
mode:
authorCorey Minyard2015-12-17 19:50:12 +0100
committerMichael S. Tsirkin2015-12-22 17:39:19 +0100
commit90b6180500a9a88f194dc58c70b87dd539405f94 (patch)
treea086e1d96c6e5d7170a2350253d5b978beee7c79 /hw/ipmi/ipmi.c
parentipmi: Add migration capability to the IPMI devices. (diff)
downloadqemu-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.c27
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;
+}