On Fri, Aug 2, 2019 at 1:41 AM Aarushi Mehta <mehta.aar...@gmail.com> wrote: > diff --git a/MAINTAINERS b/MAINTAINERS > index d6de200453..be688fcd5e 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -2530,6 +2530,13 @@ F: block/file-posix.c > F: block/file-win32.c > F: block/win32-aio.c > > +Linux io_uring > +M: Aarushi Mehta <mehta.aar...@gmail.com> > +R: Stefan Hajnoczi <ste...@redhat.com>
s/ste...@redhat.com/stefa...@redhat.com > diff --git a/block/io_uring.c b/block/io_uring.c > new file mode 100644 > index 0000000000..902b106954 > --- /dev/null > +++ b/block/io_uring.c > @@ -0,0 +1,409 @@ > +/* > + * Linux io_uring support. > + * > + * Copyright (C) 2009 IBM, Corp. > + * Copyright (C) 2009 Red Hat, Inc. > + * Copyright (C) 2019 Aarushi Mehta > + * > + * This work is licensed under the terms of the GNU GPL, version 2 or later. > + * See the COPYING file in the top-level directory. > + */ > +#include "qemu/osdep.h" > +#include <liburing.h> > +#include "qemu-common.h" > +#include "block/aio.h" > +#include "qemu/queue.h" > +#include "block/block.h" > +#include "block/raw-aio.h" > +#include "qemu/coroutine.h" > +#include "qapi/error.h" > + > +#define MAX_EVENTS 128 This is called 'entries' in the liburing documentation, so MAX_ENTRIES will be a better choice. > +typedef struct LuringState { > + AioContext *aio_context; > + > + struct io_uring ring; > + > + /* io queue for submit at batch. Protected by AioContext lock. */ > + LuringQueue io_q; > + > + /* I/O completion processing. Only runs in I/O thread. */ > + QEMUBH *completion_bh; > +} LuringState; > + > +/** > + * ioq_submit: > + * @s: AIO state > + * > + * Queues pending sqes and submits them > + * > + */ > +static int ioq_submit(LuringState *s); Now you can remove this declaration by moving the function before luring_process_completions_and_submit() > +LuringState *luring_init(Error **errp) > +{ > + int rc; > + LuringState *s; > + s = g_new0(LuringState, 1); > + struct io_uring *ring = &s->ring; Please rewrite it with declarations at the beginning of the block. Best regards, Julia Suvorova.