From patchwork Mon Jul 1 12:18:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 256114 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 291452C009E for ; Mon, 1 Jul 2013 22:32:36 +1000 (EST) Received: from localhost ([::1]:37487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtdHU-0004zl-FQ for incoming@patchwork.ozlabs.org; Mon, 01 Jul 2013 08:32:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtdH7-0004tW-ON for qemu-devel@nongnu.org; Mon, 01 Jul 2013 08:32:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Utd4l-0000t7-1m for qemu-devel@nongnu.org; Mon, 01 Jul 2013 08:19:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Utd4k-0000sg-Nd for qemu-devel@nongnu.org; Mon, 01 Jul 2013 08:19:22 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r61CJLrB019203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 1 Jul 2013 08:19:22 -0400 Received: from localhost (ovpn-112-23.ams2.redhat.com [10.36.112.23]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r61CJKPn029925; Mon, 1 Jul 2013 08:19:20 -0400 From: Stefan Hajnoczi To: Date: Mon, 1 Jul 2013 14:18:42 +0200 Message-Id: <1372681129-18528-12-git-send-email-stefanha@redhat.com> In-Reply-To: <1372681129-18528-1-git-send-email-stefanha@redhat.com> References: <1372681129-18528-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH v5 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 --- 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;