From patchwork Wed Apr 17 13:07:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 237229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id ECE792C015F for ; Wed, 17 Apr 2013 23:20:16 +1000 (EST) Received: from localhost ([::1]:38324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USS82-0004Y0-7g for incoming@patchwork.ozlabs.org; Wed, 17 Apr 2013 09:10:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USS67-0002BR-5D for qemu-devel@nongnu.org; Wed, 17 Apr 2013 09:08:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USS5z-0000CB-R6 for qemu-devel@nongnu.org; Wed, 17 Apr 2013 09:08:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USS5z-0000C3-HD for qemu-devel@nongnu.org; Wed, 17 Apr 2013 09:08:19 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3HD8Gnl029796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Apr 2013 09:08:16 -0400 Received: from localhost (dhcp-64-106.muc.redhat.com [10.32.64.106]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3HD8FVK008262; Wed, 17 Apr 2013 09:08:15 -0400 From: Stefan Hajnoczi To: Date: Wed, 17 Apr 2013 15:07:46 +0200 Message-Id: <1366204073-8468-11-git-send-email-stefanha@redhat.com> In-Reply-To: <1366204073-8468-1-git-send-email-stefanha@redhat.com> References: <1366204073-8468-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Paolo Bonzini , Anthony Liguori , pingfank@linux.vnet.ibm.com, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH v2 10/17] block/nbd: drop nbd_have_request() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org .io_flush() is no longer called so drop nbd_have_request(). We cannot drop in_flight since it is still used by other block/nbd.c code. Signed-off-by: Stefan Hajnoczi --- block/nbd.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index eff683c..7830aa4 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -270,13 +270,6 @@ static void nbd_coroutine_start(BDRVNBDState *s, struct nbd_request *request) request->handle = INDEX_TO_HANDLE(s, i); } -static int nbd_have_request(void *opaque) -{ - BDRVNBDState *s = opaque; - - return s->in_flight > 0; -} - static void nbd_reply_ready(void *opaque) { BDRVNBDState *s = opaque; @@ -333,7 +326,7 @@ static int nbd_co_send_request(BDRVNBDState *s, struct nbd_request *request, qemu_co_mutex_lock(&s->send_mutex); s->send_coroutine = qemu_coroutine_self(); qemu_aio_set_fd_handler(s->sock, nbd_reply_ready, nbd_restart_write, - nbd_have_request, s); + NULL, s); rc = nbd_send_request(s->sock, request); if (rc >= 0 && qiov) { ret = qemu_co_sendv(s->sock, qiov->iov, qiov->niov, @@ -343,7 +336,7 @@ static int nbd_co_send_request(BDRVNBDState *s, struct nbd_request *request, } } qemu_aio_set_fd_handler(s->sock, nbd_reply_ready, NULL, - nbd_have_request, s); + NULL, s); s->send_coroutine = NULL; qemu_co_mutex_unlock(&s->send_mutex); return rc; @@ -417,7 +410,7 @@ static int nbd_establish_connection(BlockDriverState *bs) * kick the reply mechanism. */ qemu_set_nonblock(sock); qemu_aio_set_fd_handler(sock, nbd_reply_ready, NULL, - nbd_have_request, s); + NULL, s); s->sock = sock; s->size = size;