From: Markus Armbruster <armbru@redhat.com>
To: Alexander Graf <graf@amazon.com>
Cc: <qemu-devel@nongnu.org>, David Hildenbrand <david@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
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>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
Ashish Kalra <ashish.kalra@amd.com>,
"Tom Lendacky" <thomas.lendacky@amd.com>
Subject: Re: [PATCH v5] hostmem-file: add offset option
Date: Tue, 04 Apr 2023 08:48:31 +0200 [thread overview]
Message-ID: <878rf82lds.fsf@pond.sub.org> (raw)
In-Reply-To: <20230403221421.60877-1-graf@amazon.com> (Alexander Graf's message of "Mon, 3 Apr 2023 22:14:21 +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.
>
> To make this work consistently, also fix up all places in QEMU that
> expect fd offsets to be 0.
>
> Signed-off-by: Alexander Graf <graf@amazon.com>
[...]
> diff --git a/qapi/qom.json b/qapi/qom.json
> index a877b879b9..f740f74be3 100644
> --- a/qapi/qom.json
> +++ b/qapi/qom.json
> @@ -635,6 +635,10 @@
> # specify the required alignment via this option.
> # 0 selects a default alignment (currently the page size). (default: 0)
> #
> +# @offset: the offset into the target file that the region starts at. You can
> +# use this option to back multiple regions with a single file. Must be
> +# a multiple of the page size. (default: 0) (since 8.1)
> +#
> # @discard-data: if true, the file contents can be destroyed when QEMU exits,
> # to avoid unnecessarily flushing data to the backing file. Note
> # that ``discard-data`` is only an optimization, and QEMU might
> @@ -655,6 +659,7 @@
> { 'struct': 'MemoryBackendFileProperties',
> 'base': 'MemoryBackendProperties',
> 'data': { '*align': 'size',
> + '*offset': 'size',
> '*discard-data': 'bool',
> 'mem-path': 'str',
> '*pmem': { 'type': 'bool', 'if': 'CONFIG_LIBPMEM' },
Acked-by: Markus Armbruster <armbru@redhat.com>
[...]
next prev parent reply other threads:[~2023-04-04 6:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 22:14 [PATCH v5] hostmem-file: add offset option Alexander Graf
2023-04-04 6:48 ` Markus Armbruster [this message]
2023-04-04 14:36 ` Peter Xu
2023-04-05 13:58 ` David Hildenbrand
2023-04-11 11:46 ` Igor Mammedov
2023-04-20 17:22 ` David Hildenbrand
2023-05-03 13:40 ` 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=878rf82lds.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 \
--cc=thomas.lendacky@amd.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).