qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2] hostmem-file: add offset option


From: Alexander Graf
Subject: Re: [PATCH v2] hostmem-file: add offset option
Date: Mon, 3 Apr 2023 21:50:26 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1


On 03.04.23 08:28, Markus Armbruster wrote:

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 a877b879b9..8f5eaa8415 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 overload multiple regions into a single fils.
single file

I'm not sure about "to overload multiple regions into a single file".
Maybe "to back multiple regions with a single file".


I like it, I'll use that version here and in the qemu-options.hx file.


Any alignment requirements?


Page size, I'll add it.



What happens when the regions overlap?


It "just works" - same as mapping the same file twice. It's up to the user to ensure that nothing bad happens because of that.


Alex





Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879



reply via email to

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