root / qemu-tool.c @ 124964b5
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 "qemu-timer.h" |
17 | 0bf9e31a | Blue Swirl | #include "qemu-log.h" |
18 | 03ff3ca3 | aliguori | |
19 | 03ff3ca3 | aliguori | #include <sys/time.h> |
20 | 03ff3ca3 | aliguori | |
21 | 03ff3ca3 | aliguori | QEMUClock *rt_clock; |
22 | 03ff3ca3 | aliguori | |
23 | 0bf9e31a | Blue Swirl | FILE *logfile; |
24 | 0bf9e31a | Blue Swirl | |
25 | 03ff3ca3 | aliguori | struct QEMUBH
|
26 | 03ff3ca3 | aliguori | { |
27 | 03ff3ca3 | aliguori | QEMUBHFunc *cb; |
28 | 03ff3ca3 | aliguori | void *opaque;
|
29 | 03ff3ca3 | aliguori | }; |
30 | 03ff3ca3 | aliguori | |
31 | 9e472e10 | aliguori | void qemu_service_io(void) |
32 | 9e472e10 | aliguori | { |
33 | 9e472e10 | aliguori | } |
34 | 9e472e10 | aliguori | |
35 | 526f0ac1 | Markus Armbruster | Monitor *cur_mon; |
36 | 526f0ac1 | Markus Armbruster | |
37 | 526f0ac1 | Markus Armbruster | int monitor_cur_is_qmp(void) |
38 | 526f0ac1 | Markus Armbruster | { |
39 | 526f0ac1 | Markus Armbruster | return 0; |
40 | 526f0ac1 | Markus Armbruster | } |
41 | 526f0ac1 | Markus Armbruster | |
42 | 526f0ac1 | Markus Armbruster | void monitor_set_error(Monitor *mon, QError *qerror)
|
43 | 526f0ac1 | Markus Armbruster | { |
44 | 526f0ac1 | Markus Armbruster | } |
45 | 526f0ac1 | Markus Armbruster | |
46 | 526f0ac1 | Markus Armbruster | void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) |
47 | 526f0ac1 | Markus Armbruster | { |
48 | 526f0ac1 | Markus Armbruster | } |
49 | 526f0ac1 | Markus Armbruster | |
50 | 376253ec | aliguori | void monitor_printf(Monitor *mon, const char *fmt, ...) |
51 | 03ff3ca3 | aliguori | { |
52 | 03ff3ca3 | aliguori | } |
53 | 03ff3ca3 | aliguori | |
54 | 376253ec | aliguori | void monitor_print_filename(Monitor *mon, const char *filename) |
55 | 03ff3ca3 | aliguori | { |
56 | 03ff3ca3 | aliguori | } |
57 | 03ff3ca3 | aliguori | |
58 | 9a1e9481 | Kevin Wolf | void async_context_push(void) |
59 | 9a1e9481 | Kevin Wolf | { |
60 | 9a1e9481 | Kevin Wolf | } |
61 | 9a1e9481 | Kevin Wolf | |
62 | 9a1e9481 | Kevin Wolf | void async_context_pop(void) |
63 | 9a1e9481 | Kevin Wolf | { |
64 | 9a1e9481 | Kevin Wolf | } |
65 | 9a1e9481 | Kevin Wolf | |
66 | 9a1e9481 | Kevin Wolf | int get_async_context_id(void) |
67 | 9a1e9481 | Kevin Wolf | { |
68 | 9a1e9481 | Kevin Wolf | return 0; |
69 | 9a1e9481 | Kevin Wolf | } |
70 | 9a1e9481 | Kevin Wolf | |
71 | 0d1ea871 | Luiz Capitulino | void monitor_protocol_event(MonitorEvent event, QObject *data)
|
72 | 0d1ea871 | Luiz Capitulino | { |
73 | 0d1ea871 | Luiz Capitulino | } |
74 | 0d1ea871 | Luiz Capitulino | |
75 | 03ff3ca3 | aliguori | QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
|
76 | 03ff3ca3 | aliguori | { |
77 | 03ff3ca3 | aliguori | QEMUBH *bh; |
78 | 03ff3ca3 | aliguori | |
79 | 03ff3ca3 | aliguori | bh = qemu_malloc(sizeof(*bh));
|
80 | 1eec614b | aliguori | bh->cb = cb; |
81 | 1eec614b | aliguori | bh->opaque = opaque; |
82 | 03ff3ca3 | aliguori | |
83 | 03ff3ca3 | aliguori | return bh;
|
84 | 03ff3ca3 | aliguori | } |
85 | 03ff3ca3 | aliguori | |
86 | 03ff3ca3 | aliguori | int qemu_bh_poll(void) |
87 | 03ff3ca3 | aliguori | { |
88 | 03ff3ca3 | aliguori | return 0; |
89 | 03ff3ca3 | aliguori | } |
90 | 03ff3ca3 | aliguori | |
91 | 03ff3ca3 | aliguori | void qemu_bh_schedule(QEMUBH *bh)
|
92 | 03ff3ca3 | aliguori | { |
93 | 03ff3ca3 | aliguori | bh->cb(bh->opaque); |
94 | 03ff3ca3 | aliguori | } |
95 | 03ff3ca3 | aliguori | |
96 | 03ff3ca3 | aliguori | void qemu_bh_cancel(QEMUBH *bh)
|
97 | 03ff3ca3 | aliguori | { |
98 | 03ff3ca3 | aliguori | } |
99 | 03ff3ca3 | aliguori | |
100 | 03ff3ca3 | aliguori | void qemu_bh_delete(QEMUBH *bh)
|
101 | 03ff3ca3 | aliguori | { |
102 | 03ff3ca3 | aliguori | qemu_free(bh); |
103 | 03ff3ca3 | aliguori | } |
104 | 03ff3ca3 | aliguori | |
105 | 03ff3ca3 | aliguori | int qemu_set_fd_handler2(int fd, |
106 | 7b27a769 | Juan Quintela | IOCanReadHandler *fd_read_poll, |
107 | 03ff3ca3 | aliguori | IOHandler *fd_read, |
108 | 03ff3ca3 | aliguori | IOHandler *fd_write, |
109 | 03ff3ca3 | aliguori | void *opaque)
|
110 | 03ff3ca3 | aliguori | { |
111 | 03ff3ca3 | aliguori | return 0; |
112 | 03ff3ca3 | aliguori | } |
113 | 03ff3ca3 | aliguori | |
114 | 03ff3ca3 | aliguori | int64_t qemu_get_clock(QEMUClock *clock) |
115 | 03ff3ca3 | aliguori | { |
116 | d92620c8 | aurel32 | qemu_timeval tv; |
117 | 474ad834 | pbrook | qemu_gettimeofday(&tv); |
118 | 03ff3ca3 | aliguori | return (tv.tv_sec * 1000000000LL + (tv.tv_usec * 1000)) / 1000000; |
119 | 03ff3ca3 | aliguori | } |