2008-09-15 15:51:35 +00:00
|
|
|
/*
|
|
|
|
* Compatibility for qemu-img/qemu-nbd
|
|
|
|
*
|
|
|
|
* Copyright IBM, Corp. 2008
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Anthony Liguori <aliguori@us.ibm.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2. See
|
|
|
|
* the COPYING file in the top-level directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "qemu-common.h"
|
2009-03-05 23:01:23 +00:00
|
|
|
#include "monitor.h"
|
2008-09-15 15:51:35 +00:00
|
|
|
#include "sysemu.h"
|
|
|
|
#include "qemu-timer.h"
|
2009-07-20 17:19:25 +00:00
|
|
|
#include "qemu-log.h"
|
2008-09-15 15:51:35 +00:00
|
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
QEMUClock *rt_clock;
|
|
|
|
|
2009-07-20 17:19:25 +00:00
|
|
|
FILE *logfile;
|
|
|
|
|
2008-09-15 15:51:35 +00:00
|
|
|
struct QEMUBH
|
|
|
|
{
|
|
|
|
QEMUBHFunc *cb;
|
|
|
|
void *opaque;
|
|
|
|
};
|
|
|
|
|
2008-10-08 19:50:24 +00:00
|
|
|
void qemu_service_io(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-03-05 23:01:23 +00:00
|
|
|
Monitor *cur_mon;
|
|
|
|
|
|
|
|
void monitor_printf(Monitor *mon, const char *fmt, ...)
|
2008-09-15 15:51:35 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-03-05 23:01:23 +00:00
|
|
|
void monitor_print_filename(Monitor *mon, const char *filename)
|
2008-09-15 15:51:35 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-10-22 15:54:38 +00:00
|
|
|
void async_context_push(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void async_context_pop(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int get_async_context_id(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-11-27 00:59:03 +00:00
|
|
|
void monitor_protocol_event(MonitorEvent event, QObject *data)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-09-15 15:51:35 +00:00
|
|
|
QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
|
|
|
|
{
|
|
|
|
QEMUBH *bh;
|
|
|
|
|
|
|
|
bh = qemu_malloc(sizeof(*bh));
|
2009-02-05 22:06:18 +00:00
|
|
|
bh->cb = cb;
|
|
|
|
bh->opaque = opaque;
|
2008-09-15 15:51:35 +00:00
|
|
|
|
|
|
|
return bh;
|
|
|
|
}
|
|
|
|
|
|
|
|
int qemu_bh_poll(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void qemu_bh_schedule(QEMUBH *bh)
|
|
|
|
{
|
|
|
|
bh->cb(bh->opaque);
|
|
|
|
}
|
|
|
|
|
|
|
|
void qemu_bh_cancel(QEMUBH *bh)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void qemu_bh_delete(QEMUBH *bh)
|
|
|
|
{
|
|
|
|
qemu_free(bh);
|
|
|
|
}
|
|
|
|
|
|
|
|
int qemu_set_fd_handler2(int fd,
|
|
|
|
IOCanRWHandler *fd_read_poll,
|
|
|
|
IOHandler *fd_read,
|
|
|
|
IOHandler *fd_write,
|
|
|
|
void *opaque)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int64_t qemu_get_clock(QEMUClock *clock)
|
|
|
|
{
|
2008-11-30 16:25:17 +00:00
|
|
|
qemu_timeval tv;
|
2008-10-29 14:37:18 +00:00
|
|
|
qemu_gettimeofday(&tv);
|
2008-09-15 15:51:35 +00:00
|
|
|
return (tv.tv_sec * 1000000000LL + (tv.tv_usec * 1000)) / 1000000;
|
|
|
|
}
|
2009-10-28 16:41:39 +00:00
|
|
|
|
|
|
|
void qemu_error(const char *fmt, ...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start(args, fmt);
|
|
|
|
vfprintf(stderr, fmt, args);
|
|
|
|
va_end(args);
|
|
|
|
}
|