diff options
author | Greg Kurz | 2020-12-01 12:37:28 +0100 |
---|---|---|
committer | David Gibson | 2020-12-14 05:54:12 +0100 |
commit | bc370a659a33865f8b55332f6363c45896bae56d (patch) | |
tree | 9295a8e9da990222c4e7ac32782d2b7f31461328 /include | |
parent | spapr: Simplify error path of spapr_core_plug() (diff) | |
download | qemu-bc370a659a33865f8b55332f6363c45896bae56d.tar.gz qemu-bc370a659a33865f8b55332f6363c45896bae56d.tar.xz qemu-bc370a659a33865f8b55332f6363c45896bae56d.zip |
spapr: spapr_drc_attach() cannot fail
All users are passing &error_abort already. Document the fact
that spapr_drc_attach() should only be passed a free DRC, which
is supposedly the case if appropriate checking is done earlier.
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201201113728.885700-5-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/ppc/spapr_drc.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h index 165b281496..def3593adc 100644 --- a/include/hw/ppc/spapr_drc.h +++ b/include/hw/ppc/spapr_drc.h @@ -235,7 +235,13 @@ SpaprDrc *spapr_drc_by_index(uint32_t index); SpaprDrc *spapr_drc_by_id(const char *type, uint32_t id); int spapr_dt_drc(void *fdt, int offset, Object *owner, uint32_t drc_type_mask); -bool spapr_drc_attach(SpaprDrc *drc, DeviceState *d, Error **errp); +/* + * These functions respectively abort if called with a device already + * attached or no device attached. In the case of spapr_drc_attach(), + * this means that the attachability of the DRC *must* be checked + * beforehand (eg. check drc->dev at pre-plug). + */ +void spapr_drc_attach(SpaprDrc *drc, DeviceState *d); void spapr_drc_detach(SpaprDrc *drc); /* Returns true if a hot plug/unplug request is pending */ |