From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, afaerber@suse.de
Subject: [Qemu-devel] [PATCH 1/9] tools: split monitor-dummy.c, clean up qemu-tool.c
Date: Mon, 17 Sep 2012 18:44:55 +0200 [thread overview]
Message-ID: <1347900303-24314-2-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1347900303-24314-1-git-send-email-pbonzini@redhat.com>
qemu-ga uses glib mostly, so it does not need a large part of the dummy
functions in qemu-tool.o (which are more related to the main loop and/or
the block layer). Split the functions required by QAPI out into
monitor-dummy.c.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 2 +-
Makefile.objs | 2 +-
monitor-dummy.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
qemu-tool.c | 54 ------------------------------------------------
4 file modificati, 66 inserzioni(+), 56 rimozioni(-)
create mode 100644 monitor-dummy.c
diff --git a/Makefile b/Makefile
index 1cd5bc8..6426d85 100644
--- a/Makefile
+++ b/Makefile
@@ -153,7 +153,7 @@ endif
qemu-img.o: qemu-img-cmds.h
tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
- qemu-timer-common.o main-loop.o notify.o \
+ qemu-timer-common.o main-loop.o notify.o monitor-dummy.o \
iohandler.o cutils.o iov.o async.o
tools-obj-$(CONFIG_POSIX) += compatfd.o
diff --git a/Makefile.objs b/Makefile.objs
index 4412757..5c622d6 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -228,7 +228,7 @@ universal-obj-y += $(qapi-obj-y)
######################################################################
# guest agent
-qga-obj-y = qga/ qemu-ga.o module.o
+qga-obj-y = qga/ qemu-ga.o module.o monitor-dummy.o
qga-obj-$(CONFIG_WIN32) += oslib-win32.o
qga-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-sockets.o qemu-option.o
diff --git a/monitor-dummy.c b/monitor-dummy.c
new file mode 100644
index 0000000..9aa87b3
--- /dev/null
+++ b/monitor-dummy.c
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ *
+ * Contributions after 2012-01-13 are licensed under the terms of the
+ * GNU GPL, version 2 or (at your option) any later version.
+ */
+
+#include "qemu-common.h"
+#include "monitor.h"
+
+Monitor *cur_mon;
+
+int monitor_cur_is_qmp(void)
+{
+ return 0;
+}
+
+void monitor_set_error(Monitor *mon, QError *qerror)
+{
+}
+
+void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
+{
+}
+
+void monitor_printf(Monitor *mon, const char *fmt, ...)
+{
+}
+
+void monitor_print_filename(Monitor *mon, const char *filename)
+{
+}
+
+void monitor_protocol_event(MonitorEvent event, QObject *data)
+{
+}
+
+int monitor_fdset_get_fd(int64_t fdset_id, int flags)
+{
+ return -1;
+}
+
+int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd)
+{
+ return -1;
+}
+
+int monitor_fdset_dup_fd_remove(int dup_fd)
+{
+ return -1;
+}
+
+int monitor_fdset_dup_fd_find(int dup_fd)
+{
+ return -1;
+}
diff --git a/qemu-tool.c b/qemu-tool.c
index 18205ba..ec5a659 100644
--- a/qemu-tool.c
+++ b/qemu-tool.c
@@ -14,7 +14,6 @@
*/
#include "qemu-common.h"
-#include "monitor.h"
#include "qemu-timer.h"
#include "qemu-log.h"
#include "migration.h"
@@ -24,64 +23,11 @@
#include <sys/time.h>
-struct QEMUBH
-{
- QEMUBHFunc *cb;
- void *opaque;
-};
-
const char *qemu_get_vm_name(void)
{
return NULL;
}
-Monitor *cur_mon;
-
-int monitor_cur_is_qmp(void)
-{
- return 0;
-}
-
-void monitor_set_error(Monitor *mon, QError *qerror)
-{
-}
-
-void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
-{
-}
-
-void monitor_printf(Monitor *mon, const char *fmt, ...)
-{
-}
-
-void monitor_print_filename(Monitor *mon, const char *filename)
-{
-}
-
-void monitor_protocol_event(MonitorEvent event, QObject *data)
-{
-}
-
-int monitor_fdset_get_fd(int64_t fdset_id, int flags)
-{
- return -1;
-}
-
-int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd)
-{
- return -1;
-}
-
-int monitor_fdset_dup_fd_remove(int dup_fd)
-{
- return -1;
-}
-
-int monitor_fdset_dup_fd_find(int dup_fd)
-{
- return -1;
-}
-
int64_t cpu_get_clock(void)
{
return qemu_get_clock_ns(rt_clock);
--
1.7.12
next prev parent reply other threads:[~2012-09-17 16:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-17 16:44 [Qemu-devel] [PATCH 0/9] build cleanups Paolo Bonzini
2012-09-17 16:44 ` Paolo Bonzini [this message]
2012-09-17 16:44 ` [Qemu-devel] [PATCH 2/9] block: move QEMUIOVector functions to iov.c Paolo Bonzini
2012-09-17 16:44 ` [Qemu-devel] [PATCH 3/9] build: avoid duplicate appearance of files Paolo Bonzini
2012-09-17 16:44 ` [Qemu-devel] [PATCH 4/9] qemu-ga: do not include the QEMU main loop and dependencies Paolo Bonzini
2012-09-17 16:44 ` [Qemu-devel] [PATCH 5/9] build: add object directory to QEMU_INCLUDES Paolo Bonzini
2012-09-17 16:45 ` [Qemu-devel] [PATCH 6/9] build: add $(TARGET_DIR) to "GEN config-target.h" lines Paolo Bonzini
2012-09-17 16:45 ` [Qemu-devel] [PATCH 7/9] build: use nesting magic for tools-obj-y Paolo Bonzini
2012-09-17 16:45 ` [Qemu-devel] [PATCH 8/9] libcacard: add include/ to CFLAGS Paolo Bonzini
2012-09-17 16:45 ` [Qemu-devel] [PATCH 9/9] libcacard: remove dependency on QEMU main loop Paolo Bonzini
2012-09-19 14:38 ` [Qemu-devel] [PATCH 0/9] build cleanups Paolo Bonzini
2012-09-25 21:04 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347900303-24314-2-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).