@@ -93,7 +93,7 @@ int qemu_aio_set_fd_handler(int fd,
node->opaque = opaque;
}
- qemu_set_fd_handler2(fd, NULL, io_read, io_write, opaque);
+ qemu_set_fd_rw_handler(fd, io_read, io_write, opaque);
return 0;
}
@@ -43,11 +43,11 @@ void qemu_aio_wait(void);
int qemu_aio_process_queue(void);
/* Register a file descriptor and associated callbacks. Behaves very similarly
- * to qemu_set_fd_handler2. Unlike qemu_set_fd_handler2, these callbacks will
+ * to qemu_set_fd_rw_handler. Unlike qemu_set_fd_rw_handler, these callbacks will
* be invoked when using either qemu_aio_wait() or qemu_aio_flush().
*
* Code that invokes AIO completion functions should rely on this function
- * instead of qemu_set_fd_handler[2].
+ * instead of qemu_set_fd_rw_handler.
*/
int qemu_aio_set_fd_handler(int fd,
IOHandler *io_read,
@@ -103,10 +103,10 @@ int qemu_set_fd_handler2(int fd,
IOHandler *fd_read,
IOHandler *fd_write,
void *opaque);
-int qemu_set_fd_handler(int fd,
- IOHandler *fd_read,
- IOHandler *fd_write,
- void *opaque);
+int qemu_set_fd_rw_handler(int fd,
+ IOHandler *fd_read,
+ IOHandler *fd_write,
+ void *opaque);
int qemu_set_fd_read_handler(int fd,
IOHandler *fd_read,
void *opaque);
@@ -90,11 +90,10 @@ void qemu_bh_delete(QEMUBH *bh)
qemu_free(bh);
}
-int qemu_set_fd_handler2(int fd,
- IOCanRWHandler *fd_read_poll,
- IOHandler *fd_read,
- IOHandler *fd_write,
- void *opaque)
+int qemu_set_fd_rw_handler(int fd,
+ IOHandler *fd_read,
+ IOHandler *fd_write,
+ void *opaque)
{
return 0;
}
@@ -2646,11 +2646,19 @@ int qemu_set_fd_handler2(int fd,
return 0;
}
-int qemu_set_fd_handler(int fd,
- IOHandler *fd_read,
- IOHandler *fd_write,
- void *opaque)
+int qemu_set_fd_rw_handler(int fd,
+ IOHandler *fd_read,
+ IOHandler *fd_write,
+ void *opaque)
{
+ if(fd_read == NULL) {
+ fprintf(stderr, "qemu_set_fd_rw_handler: NULL read handler\n");
+ exit(1);
+ }
+ if(fd_write == NULL) {
+ fprintf(stderr, "qemu_set_fd_rw_handler: NULL write handler\n");
+ exit(1);
+ }
return qemu_set_fd_handler2(fd, NULL, fd_read, fd_write, opaque);
}
@@ -93,7 +93,7 @@ static int vnc_start_vencrypt_handshake(struct VncState *vs) {
VNC_DEBUG("Handshake done, switching to TLS data mode\n");
vs->tls.wiremode = VNC_WIREMODE_TLS;
- qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, vnc_client_write, vs);
+ qemu_set_fd_rw_handler(vs->csock, vnc_client_read, vnc_client_write, vs);
start_auth_vencrypt_subauth(vs);
@@ -1356,7 +1356,7 @@ void vnc_write(VncState *vs, const void *data, size_t len)
buffer_reserve(&vs->output, len);
if (vs->csock != -1 && buffer_empty(&vs->output)) {
- qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, vnc_client_write, vs);
+ qemu_set_fd_rw_handler(vs->csock, vnc_client_read, vnc_client_write, vs);
}
buffer_append(&vs->output, data, len);
Patch consist: s/qemu_set_fd_handler(fd, read, write, o)/ qemu_set_fd_rw_handler(fd, read, write, o)/ s/qemu_set_fd_handler2(fd, NULL, read, write, o)/ qemu_set_fd_rw_handler(fd, read, write, o)/ Signed-off-by: Juan Quintela <quintela@redhat.com> --- aio.c | 2 +- qemu-aio.h | 4 ++-- qemu-char.h | 8 ++++---- qemu-tool.c | 9 ++++----- vl.c | 16 ++++++++++++---- vnc-auth-vencrypt.c | 2 +- vnc.c | 2 +- 7 files changed, 25 insertions(+), 18 deletions(-)