[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/38] qemu-io: use main_loop_wait
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 12/38] qemu-io: use main_loop_wait |
Date: |
Fri, 20 Apr 2012 19:01:18 +0200 |
From: Paolo Bonzini <address@hidden>
This will let timers run during aio_read and aio_write commands,
though not during synchronous commands.
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
cmd.c | 10 +++++-----
qemu-io.c | 7 ++++---
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/cmd.c b/cmd.c
index 0806e18..7ffbb71 100644
--- a/cmd.c
+++ b/cmd.c
@@ -25,6 +25,7 @@
#include "cmd.h"
#include "qemu-aio.h"
+#include "main-loop.h"
#define _(x) x /* not gettext support yet */
@@ -146,7 +147,7 @@ static void prep_fetchline(void *opaque)
{
int *fetchable = opaque;
- qemu_aio_set_fd_handler(STDIN_FILENO, NULL, NULL, NULL, NULL, NULL);
+ qemu_set_fd_handler(STDIN_FILENO, NULL, NULL, NULL);
*fetchable= 1;
}
@@ -193,12 +194,11 @@ void command_loop(void)
if (!prompted) {
printf("%s", get_prompt());
fflush(stdout);
- qemu_aio_set_fd_handler(STDIN_FILENO, prep_fetchline, NULL, NULL,
- NULL, &fetchable);
+ qemu_set_fd_handler(STDIN_FILENO, prep_fetchline, NULL,
&fetchable);
prompted = 1;
}
- qemu_aio_wait();
+ main_loop_wait(false);
if (!fetchable) {
continue;
@@ -221,7 +221,7 @@ void command_loop(void)
prompted = 0;
fetchable = 0;
}
- qemu_aio_set_fd_handler(STDIN_FILENO, NULL, NULL, NULL, NULL, NULL);
+ qemu_set_fd_handler(STDIN_FILENO, NULL, NULL, NULL);
}
/* from libxcmd/input.c */
diff --git a/qemu-io.c b/qemu-io.c
index 3095a22..b48364f 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -15,6 +15,7 @@
#include <libgen.h>
#include "qemu-common.h"
+#include "main-loop.h"
#include "block_int.h"
#include "cmd.h"
#include "trace/control.h"
@@ -295,7 +296,7 @@ static int do_aio_readv(QEMUIOVector *qiov, int64_t offset,
int *total)
bdrv_aio_readv(bs, offset >> 9, qiov, qiov->size >> 9,
aio_rw_done, &async_ret);
while (async_ret == NOT_DONE) {
- qemu_aio_wait();
+ main_loop_wait(false);
}
*total = qiov->size;
@@ -309,7 +310,7 @@ static int do_aio_writev(QEMUIOVector *qiov, int64_t
offset, int *total)
bdrv_aio_writev(bs, offset >> 9, qiov, qiov->size >> 9,
aio_rw_done, &async_ret);
while (async_ret == NOT_DONE) {
- qemu_aio_wait();
+ main_loop_wait(false);
}
*total = qiov->size;
@@ -352,7 +353,7 @@ static int do_aio_multiwrite(BlockRequest* reqs, int
num_reqs, int *total)
}
while (async_ret.num_done < num_reqs) {
- qemu_aio_wait();
+ main_loop_wait(false);
}
return async_ret.error < 0 ? async_ret.error : 1;
--
1.7.6.5
- [Qemu-devel] [PATCH 03/38] block: Drain requests in bdrv_close, (continued)
- [Qemu-devel] [PATCH 03/38] block: Drain requests in bdrv_close, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 02/38] qemu-iotests: Test bdrv_close while AIO is in flight, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 01/38] qemu-iotests: Always filter cluster_size out in _make_test_img, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 06/38] qemu-io: Add command line switch for cache mode, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 05/38] block: Fix spelling in comment (ineffcient -> inefficient), Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 04/38] iotests: fix error in 005, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 07/38] ide: convert ide_sector_read() to asynchronous I/O, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 10/38] qcow2: Fix return value of alloc_refcount_block, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 09/38] qcow2: Fix error handling in qcow2_alloc_cluster_offset, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 08/38] ide: convert ide_sector_write() to asynchronous I/O, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 12/38] qemu-io: use main_loop_wait,
Kevin Wolf <=
- [Qemu-devel] [PATCH 13/38] qemu-tool: map vm_clock to rt_clock, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 11/38] block: allow interrupting a co_sleep_ns, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 17/38] aio: simplify qemu_aio_wait, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 14/38] posix-aio: merge posix_aio_process_queue and posix_aio_read, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 16/38] aio: return "AIO in progress" state from qemu_aio_wait, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 18/38] qemu-img: let 'qemu-img convert' flush data, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 19/38] iotests: Resolve test failures caused by hostname, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 15/38] aio: remove process_queue callback and qemu_aio_process_queue, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 20/38] qcow2: Fix refcount block allocation during qcow2_alloc_cluster_at(), Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 22/38] qcow2: Save disk size in snapshot header, Kevin Wolf, 2012/04/20