blockdev.c uses the blk_by_qdev_id() function, so before we can use the file in tools (i.e. outside of the system emulator), we need to add a stub for it. The function always returns an error.
Signed-off-by: Kevin Wolf <[email protected]> --- stubs/blk-by-qdev-id.c | 9 +++++++++ stubs/Makefile.objs | 1 + 2 files changed, 10 insertions(+) create mode 100644 stubs/blk-by-qdev-id.c diff --git a/stubs/blk-by-qdev-id.c b/stubs/blk-by-qdev-id.c new file mode 100644 index 0000000000..0b6160fefa --- /dev/null +++ b/stubs/blk-by-qdev-id.c @@ -0,0 +1,9 @@ +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "sysemu/block-backend.h" + +BlockBackend *blk_by_qdev_id(const char *id, Error **errp) +{ + error_setg(errp, "qdev IDs/QOM paths exist only in the system emulator"); + return NULL; +} diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 9f4eb25e02..77fbf72576 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -1,5 +1,6 @@ stub-obj-y += arch_type.o stub-obj-y += bdrv-next-monitor-owned.o +stub-obj-y += blk-by-qdev-id.o stub-obj-y += blk-commit-all.o stub-obj-y += blockdev-close-all-bdrv-states.o stub-obj-y += clock-warp.o -- 2.20.1
