]> git.proxmox.com Git - qemu.git/blame - qemu-tool.c
error: Move qemu_error & friends into their own header
[qemu.git] / qemu-tool.c
CommitLineData
03ff3ca3
AL
1/*
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"
376253ec 15#include "monitor.h"
03ff3ca3 16#include "qemu-timer.h"
0bf9e31a 17#include "qemu-log.h"
2f792016 18#include "qemu-error.h"
03ff3ca3
AL
19
20#include <sys/time.h>
21
22QEMUClock *rt_clock;
23
0bf9e31a
BS
24FILE *logfile;
25
03ff3ca3
AL
26struct QEMUBH
27{
28 QEMUBHFunc *cb;
29 void *opaque;
30};
31
9e472e10
AL
32void qemu_service_io(void)
33{
34}
35
376253ec 36void monitor_printf(Monitor *mon, const char *fmt, ...)
03ff3ca3
AL
37{
38}
39
376253ec 40void monitor_print_filename(Monitor *mon, const char *filename)
03ff3ca3
AL
41{
42}
43
9a1e9481
KW
44void async_context_push(void)
45{
46}
47
48void async_context_pop(void)
49{
50}
51
52int get_async_context_id(void)
53{
54 return 0;
55}
56
0d1ea871
LC
57void monitor_protocol_event(MonitorEvent event, QObject *data)
58{
59}
60
03ff3ca3
AL
61QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
62{
63 QEMUBH *bh;
64
65 bh = qemu_malloc(sizeof(*bh));
1eec614b
AL
66 bh->cb = cb;
67 bh->opaque = opaque;
03ff3ca3
AL
68
69 return bh;
70}
71
72int qemu_bh_poll(void)
73{
74 return 0;
75}
76
77void qemu_bh_schedule(QEMUBH *bh)
78{
79 bh->cb(bh->opaque);
80}
81
82void qemu_bh_cancel(QEMUBH *bh)
83{
84}
85
86void qemu_bh_delete(QEMUBH *bh)
87{
88 qemu_free(bh);
89}
90
91int qemu_set_fd_handler2(int fd,
92 IOCanRWHandler *fd_read_poll,
93 IOHandler *fd_read,
94 IOHandler *fd_write,
95 void *opaque)
96{
97 return 0;
98}
99
100int64_t qemu_get_clock(QEMUClock *clock)
101{
d92620c8 102 qemu_timeval tv;
474ad834 103 qemu_gettimeofday(&tv);
03ff3ca3
AL
104 return (tv.tv_sec * 1000000000LL + (tv.tv_usec * 1000)) / 1000000;
105}
eeb4a3ba
NS
106
107void qemu_error(const char *fmt, ...)
108{
109 va_list args;
110
111 va_start(args, fmt);
112 vfprintf(stderr, fmt, args);
113 va_end(args);
114}