[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/7] ipmi: Don't set the timestamp on add events tha
From: |
minyard |
Subject: |
[Qemu-devel] [PATCH 3/7] ipmi: Don't set the timestamp on add events that don't have it |
Date: |
Thu, 1 Feb 2018 12:52:58 -0600 |
From: Corey Minyard <address@hidden>
According to the spec, from section "32.3 OEM SEL Record - Type
E0h-FFh", event types from 0x0e to 0xff do not have a timestamp.
So don't set it when adding those types. This required putting
the timestamp in a temporary buffer, since it's still required
to set the last addition time.
Signed-off-by: Corey Minyard <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
---
hw/ipmi/ipmi_bmc_sim.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c
index cc068f2..a0bbfd5 100644
--- a/hw/ipmi/ipmi_bmc_sim.c
+++ b/hw/ipmi/ipmi_bmc_sim.c
@@ -443,16 +443,21 @@ static void sel_inc_reservation(IPMISel *sel)
/* Returns 1 if the SEL is full and can't hold the event. */
static int sel_add_event(IPMIBmcSim *ibs, uint8_t *event)
{
+ uint8_t ts[4];
+
event[0] = 0xff;
event[1] = 0xff;
- set_timestamp(ibs, event + 3);
+ set_timestamp(ibs, ts);
+ if (event[2] < 0xe0) { /* Don't set timestamps for type 0xe0-0xff. */
+ memcpy(event + 3, ts, 4);
+ }
if (ibs->sel.next_free == MAX_SEL_SIZE) {
ibs->sel.overflow = 1;
return 1;
}
event[0] = ibs->sel.next_free & 0xff;
event[1] = (ibs->sel.next_free >> 8) & 0xff;
- memcpy(ibs->sel.last_addition, event + 3, 4);
+ memcpy(ibs->sel.last_addition, ts, 4);
memcpy(ibs->sel.sel[ibs->sel.next_free], event, 16);
ibs->sel.next_free++;
sel_inc_reservation(&ibs->sel);
--
2.7.4
- [Qemu-devel] [PULL 0/7] Small IPMI fixes, minyard, 2018/02/01
- [Qemu-devel] [PATCH 2/7] ipmi: Fix SEL get/set time commands, minyard, 2018/02/01
- [Qemu-devel] [PATCH 3/7] ipmi: Don't set the timestamp on add events that don't have it,
minyard <=
- [Qemu-devel] [PATCH 6/7] ipmi: disable IRQ and ATN on an external disconnect, minyard, 2018/02/01
- [Qemu-devel] [PATCH 1/7] Add maintainer for the IPMI code, minyard, 2018/02/01
- [Qemu-devel] [PATCH 5/7] ipmi: Fix macro issues, minyard, 2018/02/01
- [Qemu-devel] [PATCH 4/7] ipmi: Add the platform event message command, minyard, 2018/02/01
- [Qemu-devel] [PATCH 7/7] ipmi: Allow BMC device properties to be set, minyard, 2018/02/01
- Re: [Qemu-devel] [PULL 0/7] Small IPMI fixes, Peter Maydell, 2018/02/02