qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH 1/3] aio: Move AioHandler struct to header


From: Fam Zheng
Subject: [Qemu-block] [PATCH 1/3] aio: Move AioHandler struct to header
Date: Mon, 12 Oct 2015 17:55:29 +0800

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 <address@hidden>
---
 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 <address@hidden>
+ *
+ * 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]