On Mon, May 11, 2020 at 10:17:19AM +0200, Philippe Mathieu-Daudé wrote: > Rename qemu_ram_writeback() as qemu_ram_msync() to better > match what it does.
Based on Juan's comment in the other email thread I think this commit description could be expanded. Let's explain the rationale for this change: qemu_ram_writeback() and memory_region_do_writeback() have similar names but perform different functions. qemu_ram_writeback() is concerned with syncing changes to the underlying memory device (NVDIMM or file-backed RAM). memory_region_do_writeback() is concerned with dirty memory logging. Rename qemu_ram_writeback() to prevent confusion with memory_region_do_writeback(). > > Suggested-by: Stefan Hajnoczi <stefa...@redhat.com> > Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> > --- > include/exec/ram_addr.h | 4 ++-- > exec.c | 2 +- > memory.c | 3 +-- > 3 files changed, 4 insertions(+), 5 deletions(-) > > diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h > index a94809f89b..84817e19fa 100644 > --- a/include/exec/ram_addr.h > +++ b/include/exec/ram_addr.h > @@ -136,12 +136,12 @@ void qemu_ram_free(RAMBlock *block); > > int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp); > > -void qemu_ram_writeback(RAMBlock *block, ram_addr_t start, ram_addr_t > length); > +void qemu_ram_msync(RAMBlock *block, ram_addr_t start, ram_addr_t length); > > /* Clear whole block of mem */ > static inline void qemu_ram_block_writeback(RAMBlock *block) > { > - qemu_ram_writeback(block, 0, block->used_length); > + qemu_ram_msync(block, 0, block->used_length); > } > > #define DIRTY_CLIENTS_ALL ((1 << DIRTY_MEMORY_NUM) - 1) > diff --git a/exec.c b/exec.c > index 2874bb5088..f5a8cdf370 100644 > --- a/exec.c > +++ b/exec.c > @@ -2127,7 +2127,7 @@ int qemu_ram_resize(RAMBlock *block, ram_addr_t > newsize, Error **errp) > * Otherwise no-op. > * @Note: this is supposed to be a synchronous op. > */ > -void qemu_ram_writeback(RAMBlock *block, ram_addr_t start, ram_addr_t length) > +void qemu_ram_msync(RAMBlock *block, ram_addr_t start, ram_addr_t length) > { > /* The requested range should fit in within the block range */ > g_assert((start + length) <= block->used_length); > diff --git a/memory.c b/memory.c > index 73534b26f4..5bfa1429df 100644 > --- a/memory.c > +++ b/memory.c > @@ -2197,7 +2197,6 @@ void memory_region_ram_resize(MemoryRegion *mr, > ram_addr_t newsize, Error **errp > qemu_ram_resize(mr->ram_block, newsize, errp); > } > > - > void memory_region_sync(MemoryRegion *mr, hwaddr addr, hwaddr size) > { > /* > @@ -2205,7 +2204,7 @@ void memory_region_sync(MemoryRegion *mr, hwaddr addr, > hwaddr size) > * different types of memory regions > */ > if (mr->ram_block) { > - qemu_ram_writeback(mr->ram_block, addr, size); > + qemu_ram_msync(mr->ram_block, addr, size); > } > } > > -- > 2.21.3 >
signature.asc
Description: PGP signature