[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hostmem-file: add offset option
From: |
Markus Armbruster |
Subject: |
Re: [PATCH] hostmem-file: add offset option |
Date: |
Fri, 03 Feb 2023 07:59:54 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Alexander Graf <graf@amazon.com> writes:
> Add an option for hostmem-file to start the memory object at an offset
> into the target file. This is useful if multiple memory objects reside
> inside the same target file, such as a device node.
>
> In particular, it's useful to map guest memory directly into /dev/mem
> for experimentation.
>
> Signed-off-by: Alexander Graf <graf@amazon.com>
> ---
[...]
> diff --git a/qapi/qom.json b/qapi/qom.json
> index 30e76653ad..d4e16c57a3 100644
> --- a/qapi/qom.json
> +++ b/qapi/qom.json
> @@ -649,6 +649,7 @@
> { 'struct': 'MemoryBackendFileProperties',
> 'base': 'MemoryBackendProperties',
> 'data': { '*align': 'size',
> + '*offset': 'size',
> '*discard-data': 'bool',
> 'mem-path': 'str',
> '*pmem': { 'type': 'bool', 'if': 'CONFIG_LIBPMEM' },
Looks like you forgot to document the new member. You may want to ...
> diff --git a/qemu-options.hx b/qemu-options.hx
> index d59d19704b..2f12a9299e 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -4875,7 +4875,7 @@ SRST
> they are specified. Note that the 'id' property must be set. These
> objects are placed in the '/objects' path.
>
> - ``-object
> memory-backend-file,id=id,size=size,mem-path=dir,share=on|off,discard-data=on|off,merge=on|off,dump=on|off,prealloc=on|off,host-nodes=host-nodes,policy=default|preferred|bind|interleave,align=align,readonly=on|off``
> + ``-object
> memory-backend-file,id=id,size=size,mem-path=dir,share=on|off,discard-data=on|off,merge=on|off,dump=on|off,prealloc=on|off,host-nodes=host-nodes,policy=default|preferred|bind|interleave,align=align,offset=offset,readonly=on|off``
> Creates a memory file backend object, which can be used to back
> the guest RAM with huge pages.
>
> @@ -4945,6 +4945,10 @@ SRST
> such cases, users can specify the required alignment via this
> option.
>
> + The ``offset`` option specifies the offset into the target file
> + that the region starts at. You can use this parameter to overload
> + multiple regions into a single file.
> +
> The ``pmem`` option specifies whether the backing file specified
> by ``mem-path`` is in host persistent memory that can be
> accessed using the SNIA NVM programming model (e.g. Intel
... adapt the CLI documentation for it.
[...]