Skip to content

Commit

Permalink
stubs: add qemu_ram_block_from_host() and qemu_ram_get_fd()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
stefanhaRH committed Oct 26, 2022
1 parent 6d998f3 commit 701bff2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions stubs/meson.build
Expand Up @@ -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'))
Expand Down
13 changes: 13 additions & 0 deletions 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;
}

0 comments on commit 701bff2

Please sign in to comment.