On 03/09/2017 02:22 PM, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> > > Provide a helper to say whether a RAMBlock was created as a > shared mapping. > > Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com>
Reviewed-by: Halil Pasic <pa...@linux.vnet.ibm.com> > --- > exec.c | 5 +++++ > include/exec/cpu-common.h | 1 + > 2 files changed, 6 insertions(+) > > diff --git a/exec.c b/exec.c > index aabb035..1f25a12 100644 > --- a/exec.c > +++ b/exec.c > @@ -2593,6 +2593,11 @@ MemoryRegion *get_system_io(void) > return system_io; > } > > +bool qemu_ram_is_shared(RAMBlock *rb) > +{ > + return rb->flags & RAM_SHARED; > +} > + > #endif /* !defined(CONFIG_USER_ONLY) */ > > /* physical memory access (slow version, mainly for debug) */ > diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h > index b62f0d8..4d45a72 100644 > --- a/include/exec/cpu-common.h > +++ b/include/exec/cpu-common.h > @@ -69,6 +69,7 @@ RAMBlock *qemu_ram_block_from_host(void *ptr, bool > round_offset, > void qemu_ram_set_idstr(RAMBlock *block, const char *name, DeviceState *dev); > void qemu_ram_unset_idstr(RAMBlock *block); > const char *qemu_ram_get_idstr(RAMBlock *rb); > +bool qemu_ram_is_shared(RAMBlock *rb); > size_t qemu_ram_pagesize(RAMBlock *block); > size_t qemu_ram_pagesize_largest(void); >