Peter Xu <pet...@redhat.com> wrote: > Add a helper to do mmap() for a ramblock based on the cached informations. > > A trivial thing to mention is we need to move ramblock->fd setup to be > earlier, before the ramblock_file_map() call, because it'll need to > reference the fd being mapped. However that should not be a problem at > all, majorly because the fd won't be freed if successful, and if it failed > the fd will be freeed (or to be explicit, close()ed) by the caller. > > Export it - prepare to be used outside this file. > > Signed-off-by: Peter Xu <pet...@redhat.com>
Reviewed-by: Juan Quintela <quint...@redhat.com> > +void *ramblock_file_map(RAMBlock *block); I would have called it: void *qemu_ram_mmap_file(RAMBlock *block); To make clear that it is 'like' qemu_ram_mmap(), but for a file. But that is just a suggestion. Whoever does the patch, get the right to name the functions.