root / qemu-tool.c @ 94a943ef
History | View | Annotate | Download (1.4 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 | 03ff3ca3 | aliguori | QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
|
47 | 03ff3ca3 | aliguori | { |
48 | 03ff3ca3 | aliguori | QEMUBH *bh; |
49 | 03ff3ca3 | aliguori | |
50 | 03ff3ca3 | aliguori | bh = qemu_malloc(sizeof(*bh));
|
51 | 1eec614b | aliguori | bh->cb = cb; |
52 | 1eec614b | aliguori | bh->opaque = opaque; |
53 | 03ff3ca3 | aliguori | |
54 | 03ff3ca3 | aliguori | return bh;
|
55 | 03ff3ca3 | aliguori | } |
56 | 03ff3ca3 | aliguori | |
57 | 03ff3ca3 | aliguori | int qemu_bh_poll(void) |
58 | 03ff3ca3 | aliguori | { |
59 | 03ff3ca3 | aliguori | return 0; |
60 | 03ff3ca3 | aliguori | } |
61 | 03ff3ca3 | aliguori | |
62 | 03ff3ca3 | aliguori | void qemu_bh_schedule(QEMUBH *bh)
|
63 | 03ff3ca3 | aliguori | { |
64 | 03ff3ca3 | aliguori | bh->cb(bh->opaque); |
65 | 03ff3ca3 | aliguori | } |
66 | 03ff3ca3 | aliguori | |
67 | 03ff3ca3 | aliguori | void qemu_bh_cancel(QEMUBH *bh)
|
68 | 03ff3ca3 | aliguori | { |
69 | 03ff3ca3 | aliguori | } |
70 | 03ff3ca3 | aliguori | |
71 | 03ff3ca3 | aliguori | void qemu_bh_delete(QEMUBH *bh)
|
72 | 03ff3ca3 | aliguori | { |
73 | 03ff3ca3 | aliguori | qemu_free(bh); |
74 | 03ff3ca3 | aliguori | } |
75 | 03ff3ca3 | aliguori | |
76 | 03ff3ca3 | aliguori | int qemu_set_fd_handler2(int fd, |
77 | 03ff3ca3 | aliguori | IOCanRWHandler *fd_read_poll, |
78 | 03ff3ca3 | aliguori | IOHandler *fd_read, |
79 | 03ff3ca3 | aliguori | IOHandler *fd_write, |
80 | 03ff3ca3 | aliguori | void *opaque)
|
81 | 03ff3ca3 | aliguori | { |
82 | 03ff3ca3 | aliguori | return 0; |
83 | 03ff3ca3 | aliguori | } |
84 | 03ff3ca3 | aliguori | |
85 | 03ff3ca3 | aliguori | int64_t qemu_get_clock(QEMUClock *clock) |
86 | 03ff3ca3 | aliguori | { |
87 | d92620c8 | aurel32 | qemu_timeval tv; |
88 | 474ad834 | pbrook | qemu_gettimeofday(&tv); |
89 | 03ff3ca3 | aliguori | return (tv.tv_sec * 1000000000LL + (tv.tv_usec * 1000)) / 1000000; |
90 | 03ff3ca3 | aliguori | } |