blob: b39af86e0105fc165e03715ecfc3ff6ed63531b3 [file] [log] [blame]
aliguori03ff3ca2008-09-15 15:51:35 +00001/*
2 * Compatibility for qemu-img/qemu-nbd
3 *
4 * Copyright IBM, Corp. 2008
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
11 *
12 */
13
14#include "qemu-common.h"
aliguori376253e2009-03-05 23:01:23 +000015#include "monitor.h"
aliguori03ff3ca2008-09-15 15:51:35 +000016#include "qemu-timer.h"
Blue Swirl0bf9e312009-07-20 17:19:25 +000017#include "qemu-log.h"
aliguori03ff3ca2008-09-15 15:51:35 +000018
19#include <sys/time.h>
20
21QEMUClock *rt_clock;
22
Blue Swirl0bf9e312009-07-20 17:19:25 +000023FILE *logfile;
24
aliguori03ff3ca2008-09-15 15:51:35 +000025struct QEMUBH
26{
27 QEMUBHFunc *cb;
28 void *opaque;
29};
30
aliguori9e472e12008-10-08 19:50:24 +000031void qemu_service_io(void)
32{
33}
34
Markus Armbruster526f0ac2010-03-22 10:29:04 +010035Monitor *cur_mon;
36
37int monitor_cur_is_qmp(void)
38{
39 return 0;
40}
41
42void monitor_set_error(Monitor *mon, QError *qerror)
43{
44}
45
46void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
47{
48}
49
aliguori376253e2009-03-05 23:01:23 +000050void monitor_printf(Monitor *mon, const char *fmt, ...)
aliguori03ff3ca2008-09-15 15:51:35 +000051{
52}
53
aliguori376253e2009-03-05 23:01:23 +000054void monitor_print_filename(Monitor *mon, const char *filename)
aliguori03ff3ca2008-09-15 15:51:35 +000055{
56}
57
Kevin Wolf9a1e9482009-10-22 17:54:38 +020058void async_context_push(void)
59{
60}
61
62void async_context_pop(void)
63{
64}
65
66int get_async_context_id(void)
67{
68 return 0;
69}
70
Luiz Capitulino0d1ea872009-11-26 22:59:03 -020071void monitor_protocol_event(MonitorEvent event, QObject *data)
72{
73}
74
aliguori03ff3ca2008-09-15 15:51:35 +000075QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
76{
77 QEMUBH *bh;
78
79 bh = qemu_malloc(sizeof(*bh));
aliguori1eec6142009-02-05 22:06:18 +000080 bh->cb = cb;
81 bh->opaque = opaque;
aliguori03ff3ca2008-09-15 15:51:35 +000082
83 return bh;
84}
85
86int qemu_bh_poll(void)
87{
88 return 0;
89}
90
91void qemu_bh_schedule(QEMUBH *bh)
92{
93 bh->cb(bh->opaque);
94}
95
96void qemu_bh_cancel(QEMUBH *bh)
97{
98}
99
100void qemu_bh_delete(QEMUBH *bh)
101{
102 qemu_free(bh);
103}
104
105int qemu_set_fd_handler2(int fd,
Juan Quintela7b27a762010-03-11 17:55:39 +0100106 IOCanReadHandler *fd_read_poll,
aliguori03ff3ca2008-09-15 15:51:35 +0000107 IOHandler *fd_read,
108 IOHandler *fd_write,
109 void *opaque)
110{
111 return 0;
112}
113
114int64_t qemu_get_clock(QEMUClock *clock)
115{
aurel32d92620c2008-11-30 16:25:17 +0000116 qemu_timeval tv;
pbrook474ad832008-10-29 14:37:18 +0000117 qemu_gettimeofday(&tv);
aliguori03ff3ca2008-09-15 15:51:35 +0000118 return (tv.tv_sec * 1000000000LL + (tv.tv_usec * 1000)) / 1000000;
119}