summary refs log tree commit diff stats
path: root/cmd.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-04-12 14:00:51 +0200
committerKevin Wolf <kwolf@redhat.com>2012-04-19 16:29:33 +0200
commita5a5238ee49cd6a0f598f6f63a4a43dbe18d12b7 (patch)
tree4d428ab821c3ca99ea7f595e89ce451bdb693a92 /cmd.c
parent3ed9902528d0ffd244310014f7dcdcb3df3e2a04 (diff)
downloadfocaccia-qemu-a5a5238ee49cd6a0f598f6f63a4a43dbe18d12b7.tar.gz
focaccia-qemu-a5a5238ee49cd6a0f598f6f63a4a43dbe18d12b7.zip
qemu-io: use main_loop_wait
This will let timers run during aio_read and aio_write commands,
though not during synchronous commands.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd.c b/cmd.c
index 0806e18ce0..7ffbb71406 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 */