blob: ba24aa2a1396500affee35695f931ebb27adee0b [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 "sysemu.h"
17#include "qemu-timer.h"
Blue Swirl0bf9e312009-07-20 17:19:25 +000018#include "qemu-log.h"
aliguori03ff3ca2008-09-15 15:51:35 +000019
20#include <sys/time.h>
21
22QEMUClock *rt_clock;
23
Blue Swirl0bf9e312009-07-20 17:19:25 +000024FILE *logfile;
25
aliguori03ff3ca2008-09-15 15:51:35 +000026struct QEMUBH
27{
28 QEMUBHFunc *cb;
29 void *opaque;
30};
31
aliguori9e472e12008-10-08 19:50:24 +000032void qemu_service_io(void)
33{
34}
35
aliguori376253e2009-03-05 23:01:23 +000036Monitor *cur_mon;
37
38void monitor_printf(Monitor *mon, const char *fmt, ...)
aliguori03ff3ca2008-09-15 15:51:35 +000039{
40}
41
aliguori376253e2009-03-05 23:01:23 +000042void monitor_print_filename(Monitor *mon, const char *filename)
aliguori03ff3ca2008-09-15 15:51:35 +000043{
44}
45
46QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
47{
48 QEMUBH *bh;
49
50 bh = qemu_malloc(sizeof(*bh));
aliguori1eec6142009-02-05 22:06:18 +000051 bh->cb = cb;
52 bh->opaque = opaque;
aliguori03ff3ca2008-09-15 15:51:35 +000053
54 return bh;
55}
56
57int qemu_bh_poll(void)
58{
59 return 0;
60}
61
62void qemu_bh_schedule(QEMUBH *bh)
63{
64 bh->cb(bh->opaque);
65}
66
67void qemu_bh_cancel(QEMUBH *bh)
68{
69}
70
71void qemu_bh_delete(QEMUBH *bh)
72{
73 qemu_free(bh);
74}
75
76int qemu_set_fd_handler2(int fd,
77 IOCanRWHandler *fd_read_poll,
78 IOHandler *fd_read,
79 IOHandler *fd_write,
80 void *opaque)
81{
82 return 0;
83}
84
85int64_t qemu_get_clock(QEMUClock *clock)
86{
aurel32d92620c2008-11-30 16:25:17 +000087 qemu_timeval tv;
pbrook474ad832008-10-29 14:37:18 +000088 qemu_gettimeofday(&tv);
aliguori03ff3ca2008-09-15 15:51:35 +000089 return (tv.tv_sec * 1000000000LL + (tv.tv_usec * 1000)) / 1000000;
90}