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>
This commit is contained in:
David Hildenbrand 2018-06-19 15:41:41 +02:00 committed by Paolo Bonzini
parent a4659a8ef4
commit f0b7bca64d
4 changed files with 8 additions and 24 deletions

View file

@ -62,9 +62,11 @@ typedef struct PCDIMMDevice {
* @realize: called after common dimm is realized so that the dimm based
* devices get the chance to do specified operations.
* @get_memory_region: returns #MemoryRegion associated with @dimm which
* is directly mapped into the physical address space of guest.
* is directly mapped into the physical address space of guest. Will not
* fail after the device was realized.
* @get_vmstate_memory_region: returns #MemoryRegion which indicates the
* memory of @dimm should be kept during live migration.
* memory of @dimm should be kept during live migration. Will not fail
* after the device was realized.
*/
typedef struct PCDIMMDeviceClass {
/* private */