summaryrefslogtreecommitdiff
path: root/block/nfs.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-10-27 12:48:56 +0200
committerFam Zheng <famz@redhat.com>2016-10-28 21:50:18 +0800
commitaa92d6c4609e174fc6884e4b7b87367fac33cbe9 (patch)
tree6875eb1d829252d5a72b55541f4235ffb1fc9201 /block/nfs.c
parent88b062c2036cfd05b5111147736a08ba05ea05a9 (diff)
downloadqemu-aa92d6c4609e174fc6884e4b7b87367fac33cbe9.tar.gz
nfs: move nfs_set_events out of the while loops
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 <stefanha@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1477565348-5458-9-git-send-email-pbonzini@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'block/nfs.c')
-rw-r--r--block/nfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/nfs.c b/block/nfs.c
index c3db2ec58d..c8df8d851f 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);
}