From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAMFk-0006Bx-Jl for qemu-devel@nongnu.org; Fri, 16 Aug 2013 11:47:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VAMFe-00045K-47 for qemu-devel@nongnu.org; Fri, 16 Aug 2013 11:47:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27264) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAMFd-000458-RB for qemu-devel@nongnu.org; Fri, 16 Aug 2013 11:47:46 -0400 From: Stefan Hajnoczi Date: Fri, 16 Aug 2013 17:47:13 +0200 Message-Id: <1376668044-25116-8-git-send-email-stefanha@redhat.com> In-Reply-To: <1376668044-25116-1-git-send-email-stefanha@redhat.com> References: <1376668044-25116-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 07/18] block/curl: drop curl_aio_flush() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Stefan Hajnoczi .io_flush() is no longer called so drop curl_aio_flush(). The acb[] array that the function checks is still used in other parts of block/curl.c. Therefore we cannot remove acb[], it is needed. Signed-off-by: Stefan Hajnoczi --- block/curl.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/block/curl.c b/block/curl.c index 82d39ff..5999924 100644 --- a/block/curl.c +++ b/block/curl.c @@ -86,7 +86,6 @@ typedef struct BDRVCURLState { static void curl_clean_state(CURLState *s); static void curl_multi_do(void *arg); -static int curl_aio_flush(void *opaque); static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, void *s, void *sp) @@ -94,14 +93,14 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, DPRINTF("CURL (AIO): Sock action %d on fd %d\n", action, fd); switch (action) { case CURL_POLL_IN: - qemu_aio_set_fd_handler(fd, curl_multi_do, NULL, curl_aio_flush, s); + qemu_aio_set_fd_handler(fd, curl_multi_do, NULL, NULL, s); break; case CURL_POLL_OUT: - qemu_aio_set_fd_handler(fd, NULL, curl_multi_do, curl_aio_flush, s); + qemu_aio_set_fd_handler(fd, NULL, curl_multi_do, NULL, s); break; case CURL_POLL_INOUT: qemu_aio_set_fd_handler(fd, curl_multi_do, curl_multi_do, - curl_aio_flush, s); + NULL, s); break; case CURL_POLL_REMOVE: qemu_aio_set_fd_handler(fd, NULL, NULL, NULL, NULL); @@ -495,21 +494,6 @@ out_noclean: return -EINVAL; } -static int curl_aio_flush(void *opaque) -{ - BDRVCURLState *s = opaque; - int i, j; - - for (i=0; i < CURL_NUM_STATES; i++) { - for(j=0; j < CURL_NUM_ACB; j++) { - if (s->states[i].acb[j]) { - return 1; - } - } - } - return 0; -} - static void curl_aio_cancel(BlockDriverAIOCB *blockacb) { // Do we have to implement canceling? Seems to work without... -- 1.8.3.1