qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

stubs: add stubs for io_uring interface

Follow linux-aio.o and stub out the block/io_uring.o APIs that will be
missing when a binary is linked with obj-util-y but without
block-util-y (e.g. vhost-user-gpu).

For example, the stubs are necessary so that a binary using util/async.o
from obj-util-y for qemu_bh_new() links successfully. In this case
block/io_uring.o from block-util-y isn't needed and we can avoid
dragging in the block layer by linking the stubs instead. The stub
functions never get called.

Signed-off-by: Aarushi Mehta <mehta.aaru20@gmail.com>
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20200120141858.587874-6-stefanha@redhat.com
Message-Id: <20200120141858.587874-6-stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

authored by

Aarushi Mehta and committed by
Stefan Hajnoczi
06a47ef5 6663a0a3

+34
+1
MAINTAINERS
··· 2641 2641 L: qemu-block@nongnu.org 2642 2642 S: Maintained 2643 2643 F: block/io_uring.c 2644 + F: stubs/io_uring.c 2644 2645 2645 2646 qcow2 2646 2647 M: Kevin Wolf <kwolf@redhat.com>
+1
stubs/Makefile.objs
··· 13 13 stub-obj-y += iothread-lock.o 14 14 stub-obj-y += is-daemonized.o 15 15 stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o 16 + stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o 16 17 stub-obj-y += machine-init-done.o 17 18 stub-obj-y += migr-blocker.o 18 19 stub-obj-y += change-state-handler.o
+32
stubs/io_uring.c
··· 1 + /* 2 + * Linux io_uring support. 3 + * 4 + * Copyright (C) 2009 IBM, Corp. 5 + * Copyright (C) 2009 Red Hat, Inc. 6 + * 7 + * This work is licensed under the terms of the GNU GPL, version 2 or later. 8 + * See the COPYING file in the top-level directory. 9 + */ 10 + #include "qemu/osdep.h" 11 + #include "block/aio.h" 12 + #include "block/raw-aio.h" 13 + 14 + void luring_detach_aio_context(LuringState *s, AioContext *old_context) 15 + { 16 + abort(); 17 + } 18 + 19 + void luring_attach_aio_context(LuringState *s, AioContext *new_context) 20 + { 21 + abort(); 22 + } 23 + 24 + LuringState *luring_init(Error **errp) 25 + { 26 + abort(); 27 + } 28 + 29 + void luring_cleanup(LuringState *s) 30 + { 31 + abort(); 32 + }