Skip to content

Commit

Permalink
stubs: Update monitor stubs for qemu-storage-daemon
Browse files Browse the repository at this point in the history
Before we can add the monitor to qemu-storage-daemon, we need to add a
stubs for monitor_fdsets_cleanup().

We also need to make sure that stubs that are actually implemented in
the monitor core aren't linked to qemu-storage-daemon so that we don't
get linker errors because of duplicate symbols. This is achieved by
moving the stubs in question to a new file stubs/monitor-core.c.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200224143008.13362-15-kwolf@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
kevmw committed Mar 6, 2020
1 parent 5e6911c commit 6ede81d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
1 change: 1 addition & 0 deletions stubs/Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ stub-obj-y += machine-init-done.o
stub-obj-y += migr-blocker.o
stub-obj-y += change-state-handler.o
stub-obj-y += monitor.o
stub-obj-y += monitor-core.o
stub-obj-y += notify-event.o
stub-obj-y += qtest.o
stub-obj-y += replay.o
Expand Down
21 changes: 21 additions & 0 deletions stubs/monitor-core.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "qemu/osdep.h"
#include "monitor/monitor.h"
#include "qemu-common.h"
#include "qapi/qapi-emit-events.h"

__thread Monitor *cur_mon;

void monitor_init_qmp(Chardev *chr, bool pretty)
{
}

void qapi_event_emit(QAPIEvent event, QDict *qdict)
{
}

int monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
{
abort();
}


15 changes: 2 additions & 13 deletions stubs/monitor.c
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qapi-emit-events.h"
#include "monitor/monitor.h"

__thread Monitor *cur_mon;

int monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
{
abort();
}
#include "../monitor/monitor-internal.h"

int monitor_get_fd(Monitor *mon, const char *name, Error **errp)
{
error_setg(errp, "only QEMU supports file descriptor passing");
return -1;
}

void monitor_init_qmp(Chardev *chr, bool pretty)
{
}

void monitor_init_hmp(Chardev *chr, bool use_readline)
{
}

void qapi_event_emit(QAPIEvent event, QDict *qdict)
void monitor_fdsets_cleanup(void)
{
}

0 comments on commit 6ede81d

Please sign in to comment.