[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/13] stubs: add qemu_ram_block_from_host() and qemu_ram_get_fd()
From: |
Stefan Hajnoczi |
Subject: |
[PULL 11/13] stubs: add qemu_ram_block_from_host() and qemu_ram_get_fd() |
Date: |
Wed, 26 Oct 2022 14:58:44 -0400 |
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>
---
stubs/physmem.c | 13 +++++++++++++
stubs/meson.build | 1 +
2 files changed, 14 insertions(+)
create mode 100644 stubs/physmem.c
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;
+}
diff --git a/stubs/meson.build b/stubs/meson.build
index d8f3fd5c44..4314161f5f 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -29,6 +29,7 @@ stub_ss.add(files('migr-blocker.c'))
stub_ss.add(files('module-opts.c'))
stub_ss.add(files('monitor.c'))
stub_ss.add(files('monitor-core.c'))
+stub_ss.add(files('physmem.c'))
stub_ss.add(files('qemu-timer-notify-cb.c'))
stub_ss.add(files('qmp_memory_device.c'))
stub_ss.add(files('qmp-command-available.c'))
--
2.37.3
- [PULL 00/13] Block patches, Stefan Hajnoczi, 2022/10/26
- [PULL 01/13] coroutine: add flag to re-queue at front of CoQueue, Stefan Hajnoczi, 2022/10/26
- [PULL 02/13] blkio: add libblkio block driver, Stefan Hajnoczi, 2022/10/26
- [PULL 03/13] numa: call ->ram_block_removed() in ram_block_notifer_remove(), Stefan Hajnoczi, 2022/10/26
- [PULL 05/13] block: use BdrvRequestFlags type for supported flag fields, Stefan Hajnoczi, 2022/10/26
- [PULL 06/13] block: add BDRV_REQ_REGISTERED_BUF request flag, Stefan Hajnoczi, 2022/10/26
- [PULL 07/13] block: return errors from bdrv_register_buf(), Stefan Hajnoczi, 2022/10/26
- [PULL 08/13] numa: use QLIST_FOREACH_SAFE() for RAM block notifiers, Stefan Hajnoczi, 2022/10/26
- [PULL 04/13] block: pass size to bdrv_unregister_buf(), Stefan Hajnoczi, 2022/10/26
- [PULL 10/13] exec/cpu-common: add qemu_ram_get_fd(), Stefan Hajnoczi, 2022/10/26
- [PULL 11/13] stubs: add qemu_ram_block_from_host() and qemu_ram_get_fd(),
Stefan Hajnoczi <=
- [PULL 12/13] blkio: implement BDRV_REQ_REGISTERED_BUF optimization, Stefan Hajnoczi, 2022/10/26
- [PULL 13/13] virtio-blk: use BDRV_REQ_REGISTERED_BUF optimization hint, Stefan Hajnoczi, 2022/10/26
- [PULL 09/13] block: add BlockRAMRegistrar, Stefan Hajnoczi, 2022/10/26
- Re: [PULL 00/13] Block patches, Stefan Hajnoczi, 2022/10/31