mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
hostmem-file: add offset option
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> Message-Id: <20230403221421.60877-1-graf@amazon.com> Acked-by: Markus Armbruster <armbru@redhat.com> Acked-by: Peter Xu <peterx@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com>
This commit is contained in:
committed by
David Hildenbrand
parent
886c0453cb
commit
4b870dc4d0
@@ -4949,7 +4949,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.
|
||||
|
||||
@@ -5019,6 +5019,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 back
|
||||
multiple regions with 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
|
||||
|
||||
Reference in New Issue
Block a user