spapr: Minor cleanups to events handling

The rtas_error_log structure is marked packed, which strongly suggests its
precise layout is important to match an external interface.  Along with
that one could expect it to have a fixed endianness to match the same
interface.  That used to be the case - matching the layout of PAPR RTAS
event format and requiring BE fields.

Now, however, it's only used embedded within sPAPREventLogEntry with the
fields in native order, since they're processed internally.

Clear that up by removing the nested structure in sPAPREventLogEntry.
struct rtas_error_log is moved back to spapr_events.c where it is used as
a temporary to help convert the fields in sPAPREventLogEntry to the correct
in memory format when delivering an event to the guest.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2017-07-12 11:55:53 +10:00
parent fd38804b38
commit 5341258e86
3 changed files with 26 additions and 31 deletions

View file

@ -606,13 +606,9 @@ struct sPAPRTCETable {
sPAPRTCETable *spapr_tce_find_by_liobn(target_ulong liobn);
struct rtas_error_log {
struct sPAPREventLogEntry {
uint32_t summary;
uint32_t extended_length;
} QEMU_PACKED;
struct sPAPREventLogEntry {
struct rtas_error_log header;
void *extended_log;
QTAILQ_ENTRY(sPAPREventLogEntry) next;
};