From: Markus Armbruster <armbru@redhat.com>
To: Alexander Graf <graf@amazon.com>
Cc: <qemu-devel@nongnu.org>, Eduardo Habkost <eduardo@habkost.net>,
"Daniel P . Berrange" <berrange@redhat.com>,
Eric Blake <eblake@redhat.com>,
Philippe Mathieu-Daude <philmd@linaro.org>,
Peter Xu <peterx@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
David Hildenbrand <david@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Ashish Kalra <ashish.kalra@amd.com>
Subject: Re: [PATCH] hostmem-file: add offset option
Date: Fri, 03 Feb 2023 07:59:54 +0100 [thread overview]
Message-ID: <877cwzgro5.fsf@pond.sub.org> (raw)
In-Reply-To: <20230202225603.27559-1-graf@amazon.com> (Alexander Graf's message of "Thu, 2 Feb 2023 22:56:03 +0000")
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.
[...]
next prev parent reply other threads:[~2023-02-03 7:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 22:56 [PATCH] hostmem-file: add offset option Alexander Graf
2023-02-03 6:59 ` Markus Armbruster [this message]
2023-02-03 8:25 ` David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877cwzgro5.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=ashish.kalra@amd.com \
--cc=berrange@redhat.com \
--cc=david@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=graf@amazon.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).