aio-win32.c (6eeef447) aio-win32.c (e2a3a219)
1/*
2 * QEMU aio implementation
3 *
4 * Copyright IBM Corp., 2008
5 * Copyright Red Hat Inc., 2012
6 *
7 * Authors:
8 * Anthony Liguori <aliguori@us.ibm.com>

--- 8 unchanged lines hidden (view full) ---

17
18#include "qemu/osdep.h"
19#include "block/block.h"
20#include "qemu/main-loop.h"
21#include "qemu/queue.h"
22#include "qemu/sockets.h"
23#include "qapi/error.h"
24#include "qemu/rcu_queue.h"
1/*
2 * QEMU aio implementation
3 *
4 * Copyright IBM Corp., 2008
5 * Copyright Red Hat Inc., 2012
6 *
7 * Authors:
8 * Anthony Liguori <aliguori@us.ibm.com>

--- 8 unchanged lines hidden (view full) ---

17
18#include "qemu/osdep.h"
19#include "block/block.h"
20#include "qemu/main-loop.h"
21#include "qemu/queue.h"
22#include "qemu/sockets.h"
23#include "qapi/error.h"
24#include "qemu/rcu_queue.h"
25#include "qemu/error-report.h"
25
26struct AioHandler {
27 EventNotifier *e;
28 IOHandler *io_read;
29 IOHandler *io_write;
30 EventNotifierHandler *io_notify;
31 GPollFD pfd;
32 int deleted;

--- 32 unchanged lines hidden (view full) ---

65 int fd,
66 bool is_external,
67 IOHandler *io_read,
68 IOHandler *io_write,
69 AioPollFn *io_poll,
70 IOHandler *io_poll_ready,
71 void *opaque)
72{
26
27struct AioHandler {
28 EventNotifier *e;
29 IOHandler *io_read;
30 IOHandler *io_write;
31 EventNotifierHandler *io_notify;
32 GPollFD pfd;
33 int deleted;

--- 32 unchanged lines hidden (view full) ---

66 int fd,
67 bool is_external,
68 IOHandler *io_read,
69 IOHandler *io_write,
70 AioPollFn *io_poll,
71 IOHandler *io_poll_ready,
72 void *opaque)
73{
73 /* fd is a SOCKET in our case */
74 AioHandler *old_node;
75 AioHandler *node = NULL;
76
74 AioHandler *old_node;
75 AioHandler *node = NULL;
76
77 if (!fd_is_socket(fd)) {
78 error_report("fd=%d is not a socket, AIO implementation is missing", fd);
79 return;
80 }
81
77 qemu_lockcnt_lock(&ctx->list_lock);
78 QLIST_FOREACH(old_node, &ctx->aio_handlers, node) {
79 if (old_node->pfd.fd == fd && !old_node->deleted) {
80 break;
81 }
82 }
83
84 if (io_read || io_write) {

--- 358 unchanged lines hidden ---
82 qemu_lockcnt_lock(&ctx->list_lock);
83 QLIST_FOREACH(old_node, &ctx->aio_handlers, node) {
84 if (old_node->pfd.fd == fd && !old_node->deleted) {
85 break;
86 }
87 }
88
89 if (io_read || io_write) {

--- 358 unchanged lines hidden ---