Commit 42b65713 authored by Dr. David Alan Gilbert's avatar Dr. David Alan Gilbert Committed by Michael Roth
Browse files

memory: Provide an equality function for MemoryRegionSections



Provide a comparison function that checks all the fields are the same.

Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190814175535.2023-3-dgilbert@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 9366cf02)
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent c0aca935
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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
 *