diff options
author | David Hildenbrand | 2018-06-19 15:41:41 +0200 |
---|---|---|
committer | Paolo Bonzini | 2018-06-28 19:05:34 +0200 |
commit | f0b7bca64dbe8a15c1f4285c6061ce3c81a4a5c7 (patch) | |
tree | caff083cd29ac9d855fa00c5d5d8f10055860e36 /hw/mem/pc-dimm.c | |
parent | nvdimm: make get_memory_region() perform checks and initialization (diff) | |
download | qemu-f0b7bca64dbe8a15c1f4285c6061ce3c81a4a5c7.tar.gz qemu-f0b7bca64dbe8a15c1f4285c6061ce3c81a4a5c7.tar.xz qemu-f0b7bca64dbe8a15c1f4285c6061ce3c81a4a5c7.zip |
pc-dimm: get_memory_region() will not fail after realize
Let's try to reduce error handling a bit. In the plug/unplug case, the
device was realized and therefore we can assume that getting access to
the memory region will not fail.
For get_vmstate_memory_region() this is already handled that way.
Document both cases.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180619134141.29478-13-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/mem/pc-dimm.c')
-rw-r--r-- | hw/mem/pc-dimm.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 4ff39b59ef..65843bc52a 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -37,15 +37,10 @@ void pc_dimm_plug(DeviceState *dev, MachineState *machine, uint64_t align, PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm); MemoryRegion *vmstate_mr = ddc->get_vmstate_memory_region(dimm, &error_abort); + MemoryRegion *mr = ddc->get_memory_region(dimm, &error_abort); Error *local_err = NULL; - MemoryRegion *mr; uint64_t addr; - mr = ddc->get_memory_region(dimm, &local_err); - if (local_err) { - goto out; - } - addr = object_property_get_uint(OBJECT(dimm), PC_DIMM_ADDR_PROP, &local_err); if (local_err) { |