Skip to content

Commit 06a47ef

Browse files
rooshmstefanhaRH
authored andcommitted
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 <[email protected]> Acked-by: Stefano Garzarella <[email protected]> Signed-off-by: Stefan Hajnoczi <[email protected]> Message-id: [email protected] Message-Id: <[email protected]> Signed-off-by: Stefan Hajnoczi <[email protected]>
1 parent 6663a0a commit 06a47ef

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,7 @@ M: Stefan Hajnoczi <[email protected]>
26412641
26422642
S: Maintained
26432643
F: block/io_uring.c
2644+
F: stubs/io_uring.c
26442645

26452646
qcow2
26462647
M: Kevin Wolf <[email protected]>

stubs/Makefile.objs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ stub-obj-y += iothread.o
1313
stub-obj-y += iothread-lock.o
1414
stub-obj-y += is-daemonized.o
1515
stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
16+
stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o
1617
stub-obj-y += machine-init-done.o
1718
stub-obj-y += migr-blocker.o
1819
stub-obj-y += change-state-handler.o

stubs/io_uring.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
}

0 commit comments

Comments
 (0)