On Thu, May 10, 2018 at 10:08:50AM +0800, junyan...@gmx.com wrote: > diff --git a/include/exec/memory.h b/include/exec/memory.h > index 31eae0a..0460313 100644 > --- a/include/exec/memory.h > +++ b/include/exec/memory.h > @@ -507,6 +507,9 @@ void memory_region_init_resizeable_ram(MemoryRegion *mr, > void *host), > Error **errp); > #ifdef __linux__ > + > +#define QEMU_RAM_SHARE (1UL << 0)
Please expose RAMBlock flags instead of redefining this flag and call the argument ram_flags. Ultimately MemoryRegion doesn't store this or care about it. The value simply gets passed to the RAMBlock code. > + > +/** > + * qemu_ram_alloc_from_file, > + * qemu_ram_alloc_from_fd: Allocate a ram block from the specified back > + * file or device > + * > + * Parameters: > + * @size: the size in bytes of the ram block > + * @mr: the memory region where the ram block is > + * @flags: specify the properties of the ram block, which can be one > + * or bit-or of following values > + * - QEMU_RAM_SHARE: mmap the back file or device with MAP_SHARED s/back//
signature.asc
Description: PGP signature