From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> To: qemu-devel@nongnu.org, pbonzini@redhat.com, mst@redhat.com Cc: peter.maydell@linaro.org, maxime.coquelin@redhat.com, marcandre.lureau@redhat.com Subject: [Qemu-devel] [PATCH v2 2/3] memory: Provide an equality function for MemoryRegionSections Date: Wed, 14 Aug 2019 18:55:34 +0100 [thread overview] Message-ID: <20190814175535.2023-3-dgilbert@redhat.com> (raw) In-Reply-To: <20190814175535.2023-1-dgilbert@redhat.com> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com> 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> --- include/exec/memory.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index a74a58c289..ce62e847bd 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 * -- 2.21.0
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com> To: qemu-devel@nongnu.org Cc: "Peter Maydell" <peter.maydell@linaro.org>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, "Paolo Bonzini" <pbonzini@redhat.com> Subject: [PULL 2/3] memory: Provide an equality function for MemoryRegionSections Date: Wed, 25 Sep 2019 10:30:15 -0400 [thread overview] Message-ID: <20190814175535.2023-3-dgilbert@redhat.com> (raw) Message-ID: <20190925143015.NbfIbBD-VlKxFmSt2RyPaN7p6MqBtjcjijPmaW8g-Uc@z> (raw) In-Reply-To: <20190925142910.26529-1-mst@redhat.com> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com> 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> --- include/exec/memory.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index a1e6d846cc..6e67043ee0 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -504,6 +504,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 * -- MST
next prev parent reply other threads:[~2019-08-14 17:57 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-08-14 17:55 [Qemu-devel] [PATCH v2 0/3] Fix MemoryRegionSection alignment and comparison Dr. David Alan Gilbert (git) 2019-08-14 17:55 ` [Qemu-devel] [PATCH v2 1/3] memory: Align MemoryRegionSections fields Dr. David Alan Gilbert (git) 2019-09-25 14:30 ` [PULL " Michael S. Tsirkin 2019-08-14 17:55 ` Dr. David Alan Gilbert (git) [this message] 2019-09-25 14:30 ` [PULL 2/3] memory: Provide an equality function for MemoryRegionSections Michael S. Tsirkin 2019-08-14 17:55 ` [Qemu-devel] [PATCH v2 3/3] vhost: Fix memory region section comparison Dr. David Alan Gilbert (git) 2019-09-25 14:30 ` [PULL " Michael S. Tsirkin 2019-08-15 2:16 ` [Qemu-devel] [PATCH v2 0/3] Fix MemoryRegionSection alignment and comparison no-reply -- strict thread matches above, loose matches on Subject: below -- 2019-09-25 14:30 [PULL 0/3] vhost: fixes Michael S. Tsirkin 2019-09-27 10:10 ` Peter Maydell
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190814175535.2023-3-dgilbert@redhat.com \ --to=dgilbert@redhat.com \ --cc=marcandre.lureau@redhat.com \ --cc=maxime.coquelin@redhat.com \ --cc=mst@redhat.com \ --cc=pbonzini@redhat.com \ --cc=peter.maydell@linaro.org \ --cc=qemu-devel@nongnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).