qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/9 V5] memory, exec: switch file ram allocation


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 1/9 V5] memory, exec: switch file ram allocation functions to 'flags' parameters
Date: Thu, 31 May 2018 13:46:45 +0100
User-agent: Mutt/1.9.5 (2018-04-13)

On Thu, May 10, 2018 at 10:08:50AM +0800, address@hidden 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//

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]