root / qemu-tool.c @ dffbe217
History | View | Annotate | Download (1.7 kB)
1 | 03ff3ca3 | aliguori | /*
|
---|---|---|---|
2 | 03ff3ca3 | aliguori | * Compatibility for qemu-img/qemu-nbd
|
3 | 03ff3ca3 | aliguori | *
|
4 | 03ff3ca3 | aliguori | * Copyright IBM, Corp. 2008
|
5 | 03ff3ca3 | aliguori | *
|
6 | 03ff3ca3 | aliguori | * Authors:
|
7 | 03ff3ca3 | aliguori | * Anthony Liguori <aliguori@us.ibm.com>
|
8 | 03ff3ca3 | aliguori | *
|
9 | 03ff3ca3 | aliguori | * This work is licensed under the terms of the GNU GPL, version 2. See
|
10 | 03ff3ca3 | aliguori | * the COPYING file in the top-level directory.
|
11 | 03ff3ca3 | aliguori | *
|
12 | 03ff3ca3 | aliguori | */
|
13 | 03ff3ca3 | aliguori | |
14 | 03ff3ca3 | aliguori | #include "qemu-common.h" |
15 | 376253ec | aliguori | #include "monitor.h" |
16 | 03ff3ca3 | aliguori | #include "sysemu.h" |
17 | 03ff3ca3 | aliguori | #include "qemu-timer.h" |
18 | 0bf9e31a | Blue Swirl | #include "qemu-log.h" |
19 | 03ff3ca3 | aliguori | |
20 | 03ff3ca3 | aliguori | #include <sys/time.h> |
21 | 03ff3ca3 | aliguori | |
22 | 03ff3ca3 | aliguori | QEMUClock *rt_clock; |
23 | 03ff3ca3 | aliguori | |
24 | 0bf9e31a | Blue Swirl | FILE *logfile; |
25 | 0bf9e31a | Blue Swirl | |
26 | 03ff3ca3 | aliguori | struct QEMUBH
|
27 | 03ff3ca3 | aliguori | { |
28 | 03ff3ca3 | aliguori | QEMUBHFunc *cb; |
29 | 03ff3ca3 | aliguori | void *opaque;
|
30 | 03ff3ca3 | aliguori | }; |
31 | 03ff3ca3 | aliguori | |
32 | 9e472e10 | aliguori | void qemu_service_io(void) |
33 | 9e472e10 | aliguori | { |
34 | 9e472e10 | aliguori | } |
35 | 9e472e10 | aliguori | |
36 | 376253ec | aliguori | Monitor *cur_mon; |
37 | 376253ec | aliguori | |
38 | 376253ec | aliguori | void monitor_printf(Monitor *mon, const char *fmt, ...) |
39 | 03ff3ca3 | aliguori | { |
40 | 03ff3ca3 | aliguori | } |
41 | 03ff3ca3 | aliguori | |
42 | 376253ec | aliguori | void monitor_print_filename(Monitor *mon, const char *filename) |
43 | 03ff3ca3 | aliguori | { |
44 | 03ff3ca3 | aliguori | } |
45 | 03ff3ca3 | aliguori | |
46 | 9a1e9481 | Kevin Wolf | void async_context_push(void) |
47 | 9a1e9481 | Kevin Wolf | { |
48 | 9a1e9481 | Kevin Wolf | } |
49 | 9a1e9481 | Kevin Wolf | |
50 | 9a1e9481 | Kevin Wolf | void async_context_pop(void) |
51 | 9a1e9481 | Kevin Wolf | { |
52 | 9a1e9481 | Kevin Wolf | } |
53 | 9a1e9481 | Kevin Wolf | |
54 | 9a1e9481 | Kevin Wolf | int get_async_context_id(void) |
55 | 9a1e9481 | Kevin Wolf | { |
56 | 9a1e9481 | Kevin Wolf | return 0; |
57 | 9a1e9481 | Kevin Wolf | } |
58 | 9a1e9481 | Kevin Wolf | |
59 | 0d1ea871 | Luiz Capitulino | void monitor_protocol_event(MonitorEvent event, QObject *data)
|
60 | 0d1ea871 | Luiz Capitulino | { |
61 | 0d1ea871 | Luiz Capitulino | } |
62 | 0d1ea871 | Luiz Capitulino | |
63 | 03ff3ca3 | aliguori | QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
|
64 | 03ff3ca3 | aliguori | { |
65 | 03ff3ca3 | aliguori | QEMUBH *bh; |
66 | 03ff3ca3 | aliguori | |
67 | 03ff3ca3 | aliguori | bh = qemu_malloc(sizeof(*bh));
|
68 | 1eec614b | aliguori | bh->cb = cb; |
69 | 1eec614b | aliguori | bh->opaque = opaque; |
70 | 03ff3ca3 | aliguori | |
71 | 03ff3ca3 | aliguori | return bh;
|
72 | 03ff3ca3 | aliguori | } |
73 | 03ff3ca3 | aliguori | |
74 | 03ff3ca3 | aliguori | int qemu_bh_poll(void) |
75 | 03ff3ca3 | aliguori | { |
76 | 03ff3ca3 | aliguori | return 0; |
77 | 03ff3ca3 | aliguori | } |
78 | 03ff3ca3 | aliguori | |
79 | 03ff3ca3 | aliguori | void qemu_bh_schedule(QEMUBH *bh)
|
80 | 03ff3ca3 | aliguori | { |
81 | 03ff3ca3 | aliguori | bh->cb(bh->opaque); |
82 | 03ff3ca3 | aliguori | } |
83 | 03ff3ca3 | aliguori | |
84 | 03ff3ca3 | aliguori | void qemu_bh_cancel(QEMUBH *bh)
|
85 | 03ff3ca3 | aliguori | { |
86 | 03ff3ca3 | aliguori | } |
87 | 03ff3ca3 | aliguori | |
88 | 03ff3ca3 | aliguori | void qemu_bh_delete(QEMUBH *bh)
|
89 | 03ff3ca3 | aliguori | { |
90 | 03ff3ca3 | aliguori | qemu_free(bh); |
91 | 03ff3ca3 | aliguori | } |
92 | 03ff3ca3 | aliguori | |
93 | 03ff3ca3 | aliguori | int qemu_set_fd_handler2(int fd, |
94 | 03ff3ca3 | aliguori | IOCanRWHandler *fd_read_poll, |
95 | 03ff3ca3 | aliguori | IOHandler *fd_read, |
96 | 03ff3ca3 | aliguori | IOHandler *fd_write, |
97 | 03ff3ca3 | aliguori | void *opaque)
|
98 | 03ff3ca3 | aliguori | { |
99 | 03ff3ca3 | aliguori | return 0; |
100 | 03ff3ca3 | aliguori | } |
101 | 03ff3ca3 | aliguori | |
102 | 03ff3ca3 | aliguori | int64_t qemu_get_clock(QEMUClock *clock) |
103 | 03ff3ca3 | aliguori | { |
104 | d92620c8 | aurel32 | qemu_timeval tv; |
105 | 474ad834 | pbrook | qemu_gettimeofday(&tv); |
106 | 03ff3ca3 | aliguori | return (tv.tv_sec * 1000000000LL + (tv.tv_usec * 1000)) / 1000000; |
107 | 03ff3ca3 | aliguori | } |
108 | eeb4a3ba | Naphtali Sprei | |
109 | eeb4a3ba | Naphtali Sprei | void qemu_error(const char *fmt, ...) |
110 | eeb4a3ba | Naphtali Sprei | { |
111 | eeb4a3ba | Naphtali Sprei | va_list args; |
112 | eeb4a3ba | Naphtali Sprei | |
113 | eeb4a3ba | Naphtali Sprei | va_start(args, fmt); |
114 | eeb4a3ba | Naphtali Sprei | vfprintf(stderr, fmt, args); |
115 | eeb4a3ba | Naphtali Sprei | va_end(args); |
116 | eeb4a3ba | Naphtali Sprei | } |