From patchwork Thu Jul 25 15:18:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 261771 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AE0972C008A for ; Fri, 26 Jul 2013 01:24:59 +1000 (EST) Received: from localhost ([::1]:36244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2NPV-0004TT-Iz for incoming@patchwork.ozlabs.org; Thu, 25 Jul 2013 11:24:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2NKM-0004ku-13 for qemu-devel@nongnu.org; Thu, 25 Jul 2013 11:19:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2NKI-0003eV-Rn for qemu-devel@nongnu.org; Thu, 25 Jul 2013 11:19:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2NKI-0003eO-FH for qemu-devel@nongnu.org; Thu, 25 Jul 2013 11:19:34 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6PFIrdc020689 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 25 Jul 2013 11:18:53 -0400 Received: from localhost (ovpn-112-33.ams2.redhat.com [10.36.112.33]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6PFIqwD006987; Thu, 25 Jul 2013 11:18:53 -0400 From: Stefan Hajnoczi To: Date: Thu, 25 Jul 2013 17:18:18 +0200 Message-Id: <1374765505-14356-12-git-send-email-stefanha@redhat.com> In-Reply-To: <1374765505-14356-1-git-send-email-stefanha@redhat.com> References: <1374765505-14356-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Ping Fan Liu , alex@alex.org.uk, Michael Roth , Stefan Hajnoczi , Paolo Bonzini Subject: [Qemu-devel] [PATCH v6 11/18] 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 Reviewed-by: Wenchao Xia --- block/nbd.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index 9c480b8..f1619f9 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -279,13 +279,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; @@ -342,7 +335,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); if (qiov) { if (!s->is_unix) { socket_set_cork(s->sock, 1); @@ -362,7 +355,7 @@ static int nbd_co_send_request(BDRVNBDState *s, struct nbd_request *request, rc = nbd_send_request(s->sock, 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; @@ -439,7 +432,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;