aboutsummaryrefslogtreecommitdiff
path: root/qemu-tool.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-09-12 16:20:11 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2011-12-22 11:53:58 +0100
commitcbcfa0418f0c196afa765f5c9837b9344d1adcf3 (patch)
treed6d9700577d061ddde7e7bf860a72b0de9a2aaed /qemu-tool.c
parentd9a73806585fd89f75f0c411839151863dac7f61 (diff)
downloadqemu-cbcfa0418f0c196afa765f5c9837b9344d1adcf3.zip
qemu-cbcfa0418f0c196afa765f5c9837b9344d1adcf3.tar.gz
qemu-cbcfa0418f0c196afa765f5c9837b9344d1adcf3.tar.bz2
link the main loop and its dependencies into the tools
Using the main loop code from QEMU enables tools to operate fully asynchronously. Advantages include better Windows portability (for some definition of portability) over glib's. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-tool.c')
-rw-r--r--qemu-tool.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/qemu-tool.c b/qemu-tool.c
index 5df7279..226b6e8 100644
--- a/qemu-tool.c
+++ b/qemu-tool.c
@@ -16,12 +16,12 @@
#include "qemu-timer.h"
#include "qemu-log.h"
#include "migration.h"
+#include "main-loop.h"
+#include "qemu_socket.h"
+#include "slirp/libslirp.h"
#include <sys/time.h>
-QEMUClock *rt_clock;
-QEMUClock *vm_clock;
-
FILE *logfile;
struct QEMUBH
@@ -57,41 +57,45 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
{
}
-int qemu_set_fd_handler2(int fd,
- IOCanReadHandler *fd_read_poll,
- IOHandler *fd_read,
- IOHandler *fd_write,
- void *opaque)
+int64 cpu_get_clock(void)
{
- return 0;
+ abort();
}
-void qemu_notify_event(void)
+int64 cpu_get_icount(void)
{
+ abort();
}
-QEMUTimer *qemu_new_timer(QEMUClock *clock, int scale,
- QEMUTimerCB *cb, void *opaque)
+void qemu_mutex_lock_iothread(void)
{
- return g_malloc(1);
}
-void qemu_free_timer(QEMUTimer *ts)
+void qemu_mutex_unlock_iothread(void)
{
- g_free(ts);
}
-void qemu_del_timer(QEMUTimer *ts)
+int use_icount;
+
+void qemu_clock_warp(QEMUClock *clock)
{
}
-void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time)
+static void __attribute__((constructor)) init_main_loop(void)
{
+ init_clocks();
+ init_timer_alarm();
+ qemu_clock_enable(vm_clock, false);
}
-int64_t qemu_get_clock_ns(QEMUClock *clock)
+void slirp_select_fill(int *pnfds, fd_set *readfds,
+ fd_set *writefds, fd_set *xfds)
+{
+}
+
+void slirp_select_poll(fd_set *readfds, fd_set *writefds,
+ fd_set *xfds, int select_error)
{
- return 0;
}
void migrate_add_blocker(Error *reason)