Received: from eggs.gnu.org ([2001:4830:134:3::10]:46530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bziFe-0003OB-7H for qemu-devel@nongnu.org; Thu, 27 Oct 2016 06:49:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bziFd-00044x-GO for qemu-devel@nongnu.org; Thu, 27 Oct 2016 06:49:38 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:33963) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bziFd-00044c-9y for qemu-devel@nongnu.org; Thu, 27 Oct 2016 06:49:37 -0400 Received: by mail-wm0-x243.google.com with SMTP id y138so2047992wme.1 for ; Thu, 27 Oct 2016 03:49:37 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 27 Oct 2016 12:48:56 +0200 Message-Id: <1477565348-5458-9-git-send-email-pbonzini@redhat.com> In-Reply-To: <1477565348-5458-1-git-send-email-pbonzini@redhat.com> References: <1477565348-5458-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 08/20] nfs: move nfs_set_events out of the while loops List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, stefanha@redhat.com nfs_set_events only needs to be called once before entering the while loop; afterwards, nfs_process_read and nfs_process_write take care of it. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/nfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/nfs.c b/block/nfs.c index c3db2ec..c8df8d8 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -149,8 +149,8 @@ static int coroutine_fn nfs_co_readv(BlockDriverState *bs, return -ENOMEM; } + nfs_set_events(client); while (!task.complete) { - nfs_set_events(client); qemu_coroutine_yield(); } @@ -191,8 +191,8 @@ static int coroutine_fn nfs_co_writev(BlockDriverState *bs, return -ENOMEM; } + nfs_set_events(client); while (!task.complete) { - nfs_set_events(client); qemu_coroutine_yield(); } @@ -217,8 +217,8 @@ static int coroutine_fn nfs_co_flush(BlockDriverState *bs) return -ENOMEM; } + nfs_set_events(client); while (!task.complete) { - nfs_set_events(client); qemu_coroutine_yield(); } @@ -513,8 +513,8 @@ static int64_t nfs_get_allocated_file_size(BlockDriverState *bs) return -ENOMEM; } + nfs_set_events(client); while (!task.complete) { - nfs_set_events(client); aio_poll(client->aio_context, true); } -- 2.7.4