summaryrefslogtreecommitdiffstats
path: root/hw/mem/pc-dimm.c
diff options
context:
space:
mode:
authorDavid Hildenbrand2018-10-05 11:20:15 +0200
committerEduardo Habkost2018-10-24 11:44:59 +0200
commite40c5b6b3f5483bd4e1f493853e6a1f12eba1e93 (patch)
tree7edcef1063bb38599fb2d0931973f939faabb51d /hw/mem/pc-dimm.c
parentmemory-device: introduce separate config option (diff)
downloadqemu-e40c5b6b3f5483bd4e1f493853e6a1f12eba1e93.tar.gz
qemu-e40c5b6b3f5483bd4e1f493853e6a1f12eba1e93.tar.xz
qemu-e40c5b6b3f5483bd4e1f493853e6a1f12eba1e93.zip
memory-device: forward errors in get_region_size()/get_plugged_size()
Let's properly forward the errors, so errors from get_region_size() / get_plugged_size() can be handled. Users right now call both functions after the device has been realized, which is will never fail, so it is fine to continue using error_abort. While at it, remove a leftover error check (suggested by Igor). Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20181005092024.14344-8-david@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/mem/pc-dimm.c')
-rw-r--r--hw/mem/pc-dimm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index f46fb7ada2..130f78d0de 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -234,14 +234,15 @@ static uint64_t pc_dimm_md_get_addr(const MemoryDeviceState *md)
return dimm->addr;
}
-static uint64_t pc_dimm_md_get_region_size(const MemoryDeviceState *md)
+static uint64_t pc_dimm_md_get_region_size(const MemoryDeviceState *md,
+ Error **errp)
{
/* dropping const here is fine as we don't touch the memory region */
PCDIMMDevice *dimm = PC_DIMM(md);
const PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(md);
MemoryRegion *mr;
- mr = ddc->get_memory_region(dimm, &error_abort);
+ mr = ddc->get_memory_region(dimm, errp);
if (!mr) {
return 0;
}