From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlZpH-00042D-D9 for qemu-devel@nongnu.org; Mon, 12 Oct 2015 05:55:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlZpG-00066Z-HI for qemu-devel@nongnu.org; Mon, 12 Oct 2015 05:55:27 -0400 From: Fam Zheng Date: Mon, 12 Oct 2015 17:55:29 +0800 Message-Id: <1444643731-15346-2-git-send-email-famz@redhat.com> In-Reply-To: <1444643731-15346-1-git-send-email-famz@redhat.com> References: <1444643731-15346-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH 1/3] aio: Move AioHandler struct to header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-block@nongnu.org, Stefan Hajnoczi AioHandler for win32 is a superset of the counterpart in aio-posix, move that to a new header "aio-internal.h" and drop the posix variation. Signed-off-by: Fam Zheng --- aio-posix.c | 11 +---------- aio-win32.c | 12 +----------- include/block/aio-internal.h | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 include/block/aio-internal.h diff --git a/aio-posix.c b/aio-posix.c index d477033..7ae54fc 100644 --- a/aio-posix.c +++ b/aio-posix.c @@ -17,16 +17,7 @@ #include "block/block.h" #include "qemu/queue.h" #include "qemu/sockets.h" - -struct AioHandler -{ - GPollFD pfd; - IOHandler *io_read; - IOHandler *io_write; - int deleted; - void *opaque; - QLIST_ENTRY(AioHandler) node; -}; +#include "block/aio-internal.h" static AioHandler *find_aio_handler(AioContext *ctx, int fd) { diff --git a/aio-win32.c b/aio-win32.c index 50a6867..f018934 100644 --- a/aio-win32.c +++ b/aio-win32.c @@ -19,17 +19,7 @@ #include "block/block.h" #include "qemu/queue.h" #include "qemu/sockets.h" - -struct AioHandler { - EventNotifier *e; - IOHandler *io_read; - IOHandler *io_write; - EventNotifierHandler *io_notify; - GPollFD pfd; - int deleted; - void *opaque; - QLIST_ENTRY(AioHandler) node; -}; +#include "block/aio-internal.h" void aio_set_fd_handler(AioContext *ctx, int fd, diff --git a/include/block/aio-internal.h b/include/block/aio-internal.h new file mode 100644 index 0000000..2ffbcdc --- /dev/null +++ b/include/block/aio-internal.h @@ -0,0 +1,30 @@ +/* + * QEMU aio internal interface + * + * Copyright Red Hat, Inc. 2015 + * + * Authors: + * Fam Zheng + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_AIO_INTERNAL_H +#define QEMU_AIO_INTERNAL_H + +#include "block/aio.h" + +struct AioHandler { + EventNotifier *e; + IOHandler *io_read; + IOHandler *io_write; + EventNotifierHandler *io_notify; + GPollFD pfd; + int deleted; + void *opaque; + QLIST_ENTRY(AioHandler) node; +}; + +#endif -- 2.6.1