]> git.proxmox.com Git - mirror_qemu.git/commit
hostmem-file: add offset option
authorAlexander Graf <graf@amazon.com>
Mon, 3 Apr 2023 22:14:21 +0000 (22:14 +0000)
committerDavid Hildenbrand <david@redhat.com>
Tue, 23 May 2023 14:47:03 +0000 (16:47 +0200)
commit4b870dc4d0c0895859d34d14ce0272a4bcbccf78
tree8af35d1db6ba0cd63419627870a0a75aec9bf150
parent886c0453cbf10eebd42a9ccf89c3e46eb389c357
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>
backends/hostmem-file.c
hw/virtio/vhost-user.c
include/exec/memory.h
include/exec/ram_addr.h
include/exec/ramblock.h
qapi/qom.json
qemu-options.hx
softmmu/memory.c
softmmu/physmem.c