qemu/include/hw/ppc
Greg Kurz a005b3ef50 xics: report errors with the QEMU Error API
Using the return value to report errors is error prone:
- xics_alloc() returns -1 on error but spapr_vio_busdev_realize() errors
  on 0
- xics_alloc_block() returns the unclear value of ics->offset - 1 on error
  but both rtas_ibm_change_msi() and spapr_phb_realize() error on 0

This patch adds an errp argument to xics_alloc() and xics_alloc_block() to
report errors. The return value of these functions is a valid IRQ number
if errp is NULL. It is undefined otherwise.

The corresponding error traces get promotted to error messages. Note that
the "can't allocate IRQ" error message in spapr_vio_busdev_realize() also
moves to xics_alloc(). Similar error message consolidation isn't really
applicable to xics_alloc_block() because callers have extra context (device
config address, MSI or MSIX).

This fixes the issues mentioned above.

Based on previous work from Brian W. Hart.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-02-28 16:19:02 +11:00
..
mac_dbdma.h macio: remove remainder_len DBDMA_io property 2015-06-04 20:25:39 -04:00
openpic.h intc/openpic_kvm: Fix QOM and build issues 2013-07-01 01:11:15 +02:00
ppc4xx.h hw: move headers to include/ 2013-04-08 18:13:10 +02:00
ppc_e500.h intc/openpic: Build openpic only once 2013-07-09 21:33:02 +02:00
ppc.h PPC: mac99: Move NVRAM to page boundary when necessary 2014-09-08 12:50:47 +02:00
spapr_drc.h spapr_drc: use RTAS return codes for methods called by RTAS 2015-09-23 10:51:10 +10:00
spapr_vio.h spapr vio: fix to incomplete QOMify 2016-01-11 15:29:05 +11:00
spapr.h pseries: Simplify handling of the hash page table fd 2016-02-17 09:59:30 +11:00
xics.h xics: report errors with the QEMU Error API 2016-02-28 16:19:02 +11:00