diff options
author | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2019-08-14 18:55:34 +0100 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2019-11-12 16:23:54 -0600 |
commit | 42b6571357a083f721a27daa6dfdc69e4bd516bd (patch) | |
tree | 054f4cfcb17428891ab71dafb57e53c9251dfbef | |
parent | c0aca9352d51c102c55fe29ce5c1bf8e74a5183e (diff) |
memory: Provide an equality function for MemoryRegionSections
Provide a comparison function that checks all the fields are the same.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190814175535.2023-3-dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 9366cf02e4e31c2a8128904d4d8290a0fad5f888)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | include/exec/memory.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h index e28d79cc59..611a89122d 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -496,6 +496,18 @@ struct MemoryRegionSection { bool nonvolatile; }; +static inline bool MemoryRegionSection_eq(MemoryRegionSection *a, + MemoryRegionSection *b) +{ + return a->mr == b->mr && + a->fv == b->fv && + a->offset_within_region == b->offset_within_region && + a->offset_within_address_space == b->offset_within_address_space && + int128_eq(a->size, b->size) && + a->readonly == b->readonly && + a->nonvolatile == b->nonvolatile; +} + /** * memory_region_init: Initialize a memory region * |