Skip to content

Commit

Permalink
stubs: fully replace qemu-tool.c and qemu-user.c
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Jan 12, 2013
1 parent 4d45457 commit 5708fc6
Show file tree
Hide file tree
Showing 20 changed files with 138 additions and 167 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -171,7 +171,7 @@ install-libcacard: libcacard.la

qemu-img.o: qemu-img-cmds.h

tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-timer.o \
main-loop.o iohandler.o error.o
tools-obj-$(CONFIG_POSIX) += compatfd.o

Expand Down
3 changes: 1 addition & 2 deletions Makefile.objs
Expand Up @@ -130,7 +130,6 @@ user-obj-y += envlist.o path.o
user-obj-y += tcg-runtime.o host-utils.o
user-obj-y += cache-utils.o
user-obj-y += module.o
user-obj-y += qemu-user.o
user-obj-y += qom/

######################################################################
Expand Down Expand Up @@ -171,7 +170,7 @@ universal-obj-y += $(qapi-obj-y)
######################################################################
# guest agent

qga-obj-y = qga/ module.o qemu-tool.o
qga-obj-y = qga/ module.o
qga-obj-$(CONFIG_POSIX) += qemu-sockets.o qemu-option.o

vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion exec.c
Expand Up @@ -78,7 +78,7 @@ DEFINE_TLS(CPUArchState *,cpu_single_env);
/* 0 = Do not count executed instructions.
1 = Precise instruction counting.
2 = Adaptive rate instruction counting. */
int use_icount = 0;
int use_icount;

#if !defined(CONFIG_USER_ONLY)

Expand Down
115 changes: 0 additions & 115 deletions qemu-tool.c

This file was deleted.

37 changes: 0 additions & 37 deletions qemu-user.c

This file was deleted.

17 changes: 15 additions & 2 deletions stubs/Makefile.objs
@@ -1,11 +1,24 @@
stub-obj-y += arch-query-cpu-def.o
stub-obj-y += clock-warp.o
stub-obj-y += cpu-get-clock.o
stub-obj-y += cpu-get-icount.o
stub-obj-y += fdset-add-fd.o
stub-obj-y += fdset-find-fd.o
stub-obj-y += fdset-get-fd.o
stub-obj-y += fdset-remove-fd.o
stub-obj-y += get-fd.o
stub-obj-y += set-fd-handler.o
stub-obj-y += get-vm-name.o
stub-obj-y += iothread-lock.o
stub-obj-y += migr-blocker.o
stub-obj-y += mon-is-qmp.o
stub-obj-y += mon-printf.o
stub-obj-y += mon-print-filename.o
stub-obj-y += mon-protocol-event.o
stub-obj-y += mon-set-error.o
stub-obj-y += reset.o
stub-obj-y += vmstate.o
stub-obj-y += set-fd-handler.o
stub-obj-y += slirp.o
stub-obj-y += sysbus.o
stub-obj-y += vm-stop.o
stub-obj-y += vmstate.o
stub-obj-$(CONFIG_WIN32) += fd-register.o
7 changes: 7 additions & 0 deletions stubs/clock-warp.c
@@ -0,0 +1,7 @@
#include "qemu-common.h"
#include "qemu/timer.h"

void qemu_clock_warp(QEMUClock *clock)
{
}

7 changes: 7 additions & 0 deletions stubs/cpu-get-clock.c
@@ -0,0 +1,7 @@
#include "qemu-common.h"
#include "qemu/timer.h"

int64_t cpu_get_clock(void)
{
return get_clock_realtime();
}
9 changes: 9 additions & 0 deletions stubs/cpu-get-icount.c
@@ -0,0 +1,9 @@
#include "qemu-common.h"
#include "qemu/timer.h"

int use_icount;

int64_t cpu_get_icount(void)
{
abort();
}
7 changes: 7 additions & 0 deletions stubs/get-vm-name.c
@@ -0,0 +1,7 @@
#include "qemu-common.h"

const char *qemu_get_vm_name(void)
{
return NULL;
}

10 changes: 10 additions & 0 deletions stubs/iothread-lock.c
@@ -0,0 +1,10 @@
#include "qemu-common.h"
#include "qemu/main-loop.h"

void qemu_mutex_lock_iothread(void)
{
}

void qemu_mutex_unlock_iothread(void)
{
}
10 changes: 10 additions & 0 deletions stubs/migr-blocker.c
@@ -0,0 +1,10 @@
#include "qemu-common.h"
#include "migration/migration.h"

void migrate_add_blocker(Error *reason)
{
}

void migrate_del_blocker(Error *reason)
{
}
7 changes: 7 additions & 0 deletions stubs/mon-is-qmp.c
@@ -0,0 +1,7 @@
#include "qemu-common.h"
#include "monitor/monitor.h"

int monitor_cur_is_qmp(void)
{
return 0;
}
6 changes: 6 additions & 0 deletions stubs/mon-print-filename.c
@@ -0,0 +1,6 @@
#include "qemu-common.h"
#include "monitor/monitor.h"

void monitor_print_filename(Monitor *mon, const char *filename)
{
}
10 changes: 10 additions & 0 deletions stubs/mon-printf.c
@@ -0,0 +1,10 @@
#include "qemu-common.h"
#include "monitor/monitor.h"

void monitor_printf(Monitor *mon, const char *fmt, ...)
{
}

void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
{
}
6 changes: 6 additions & 0 deletions stubs/mon-protocol-event.c
@@ -0,0 +1,6 @@
#include "qemu-common.h"
#include "monitor/monitor.h"

void monitor_protocol_event(MonitorEvent event, QObject *data)
{
}
8 changes: 8 additions & 0 deletions stubs/mon-set-error.c
@@ -0,0 +1,8 @@
#include "qemu-common.h"
#include "monitor/monitor.h"

Monitor *cur_mon;

void monitor_set_error(Monitor *mon, QError *qerror)
{
}
17 changes: 17 additions & 0 deletions stubs/slirp.c
@@ -0,0 +1,17 @@
#include "qemu-common.h"
#include "slirp/slirp.h"

void slirp_update_timeout(uint32_t *timeout)
{
}

void slirp_select_fill(int *pnfds, fd_set *readfds,
fd_set *writefds, fd_set *xfds)
{
}

void slirp_select_poll(fd_set *readfds, fd_set *writefds,
fd_set *xfds, int select_error)
{
}

7 changes: 7 additions & 0 deletions stubs/vm-stop.c
@@ -0,0 +1,7 @@
#include "qemu-common.h"
#include "sysemu/sysemu.h"

void vm_stop(RunState state)
{
abort();
}
18 changes: 9 additions & 9 deletions tests/Makefile
Expand Up @@ -70,7 +70,7 @@ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \
tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \
tests/test-qmp-commands.o tests/test-visitor-serialization.o

test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) qemu-tool.o
test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y)
test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o
test-qapi-obj-y += module.o

Expand All @@ -81,7 +81,7 @@ tests/check-qstring$(EXESUF): tests/check-qstring.o qstring.o
tests/check-qdict$(EXESUF): tests/check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o
tests/check-qlist$(EXESUF): tests/check-qlist.o qlist.o qint.o
tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o
tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) qemu-tool.o
tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) libqemustub.a
tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) iov.o libqemustub.a
tests/test-aio$(EXESUF): tests/test-aio.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a
tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a
Expand All @@ -98,13 +98,13 @@ $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@")


tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y)
tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y)
tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y)
tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y)
tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y)
tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemustub.a
tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) libqemustub.a
tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemustub.a
tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemustub.a
tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemustub.a
tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemustub.a
tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemustub.a

tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y)
tests/m48t59-test$(EXESUF): tests/m48t59-test.o $(trace-obj-y)
Expand Down

0 comments on commit 5708fc6

Please sign in to comment.