Loading cmd.c +5 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include "cmd.h" #include "qemu-aio.h" #include "main-loop.h" #define _(x) x /* not gettext support yet */ Loading Loading @@ -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; } Loading Loading @@ -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; Loading @@ -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 */ Loading qemu-io.c +4 −3 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -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; Loading @@ -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; Loading Loading @@ -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; Loading Loading
cmd.c +5 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include "cmd.h" #include "qemu-aio.h" #include "main-loop.h" #define _(x) x /* not gettext support yet */ Loading Loading @@ -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; } Loading Loading @@ -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; Loading @@ -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 */ Loading
qemu-io.c +4 −3 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -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; Loading @@ -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; Loading Loading @@ -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; Loading