aboutsummaryrefslogtreecommitdiff
path: root/stubs/physmem.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2022-10-13 14:59:06 -0400
committerStefan Hajnoczi <stefanha@redhat.com>2022-10-26 14:56:42 -0400
commit701bff24deba59a095c6b5cade15e764d56909f6 (patch)
tree025525a53dcd77e69d1dc0c32e05dd0cf2754848 /stubs/physmem.c
parent6d998f3cbfebabea7882848a65c38f454d2a37c4 (diff)
stubs: add qemu_ram_block_from_host() and qemu_ram_get_fd()
The blkio block driver will need to look up the file descriptor for a given pointer. This is possible in softmmu builds where the RAMBlock API is available for querying guest RAM. Add stubs so tools like qemu-img that link the block layer still build successfully. In this case there is no guest RAM but that is fine. Bounce buffers and their file descriptors will be allocated with libblkio's blkio_alloc_mem_region() so we won't rely on QEMU's qemu_ram_get_fd() in that case. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20221013185908.1297568-12-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'stubs/physmem.c')
-rw-r--r--stubs/physmem.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/stubs/physmem.c b/stubs/physmem.c
new file mode 100644
index 0000000000..1fc5f2df29
--- /dev/null
+++ b/stubs/physmem.c
@@ -0,0 +1,13 @@
+#include "qemu/osdep.h"
+#include "exec/cpu-common.h"
+
+RAMBlock *qemu_ram_block_from_host(void *ptr, bool round_offset,
+ ram_addr_t *offset)
+{
+ return NULL;
+}
+
+int qemu_ram_get_fd(RAMBlock *rb)
+{
+ return -1;
+}