From patchwork Fri Jun 14 11:43:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 251392 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 817FC2C0098 for ; Fri, 14 Jun 2013 21:46:50 +1000 (EST) Received: from localhost ([::1]:48798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnSSu-0004bz-BJ for incoming@patchwork.ozlabs.org; Fri, 14 Jun 2013 07:46:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnSQl-0002II-Cy for qemu-devel@nongnu.org; Fri, 14 Jun 2013 07:44:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnSQi-0006xI-9I for qemu-devel@nongnu.org; Fri, 14 Jun 2013 07:44:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnSQh-0006wq-Nu for qemu-devel@nongnu.org; Fri, 14 Jun 2013 07:44:31 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5EBiTZP026340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 14 Jun 2013 07:44:29 -0400 Received: from localhost (ovpn-112-29.ams2.redhat.com [10.36.112.29]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5EBiS3S003347; Fri, 14 Jun 2013 07:44:29 -0400 From: Stefan Hajnoczi To: Date: Fri, 14 Jun 2013 13:43:56 +0200 Message-Id: <1371210243-6099-11-git-send-email-stefanha@redhat.com> In-Reply-To: <1371210243-6099-1-git-send-email-stefanha@redhat.com> References: <1371210243-6099-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 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 , Ping Fan Liu , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH v4 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 30e3b78..80d2b31 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); if (qiov) { if (!s->is_unix) { socket_set_cork(s->sock, 1); @@ -353,7 +346,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; @@ -430,7 +423,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;