aboutsummaryrefslogtreecommitdiff
path: root/monitor/hmp-cmds.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2019-06-13 17:33:59 +0200
committerMarkus Armbruster <armbru@redhat.com>2019-06-17 20:36:56 +0200
commit5bce308aaaab5b1b1a460b7f13940a132278e34c (patch)
tree879532127a883b39608377c520b2d1b73113f51b /monitor/hmp-cmds.c
parentf1b3ccfaa682b7b5d0043ab934660a49e33d0139 (diff)
monitor: Create monitor-internal.h with common definitions
Before we can split monitor/misc.c, we need to create a header file that contains the common definitions that will be used by multiple source files. For a start, add the type definitions for Monitor, MonitorHMP and MonitorQMP and their dependencies. We'll add functions as needed when splitting monitor/misc.c. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20190613153405.24769-10-kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Header guard symbol tidied up, superfluous #include dropped, FIXME in hmp_change() resolved] Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'monitor/hmp-cmds.c')
-rw-r--r--monitor/hmp-cmds.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index c917e24d9c..c283dde0e9 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -24,7 +24,7 @@
#include "qemu/option.h"
#include "qemu/timer.h"
#include "qemu/sockets.h"
-#include "monitor/monitor.h"
+#include "monitor/monitor-internal.h"
#include "monitor/qdev.h"
#include "qapi/error.h"
#include "qapi/opts-visitor.h"
@@ -1943,8 +1943,7 @@ static void hmp_change_read_arg(void *opaque, const char *password,
void hmp_change(Monitor *mon, const QDict *qdict)
{
- /* FIXME Make MonitorHMP public and use container_of */
- MonitorHMP *hmp_mon = (MonitorHMP *)mon;
+ MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
const char *device = qdict_get_str(qdict, "device");
const char *target = qdict_get_str(qdict, "target");
const char *arg = qdict_get_try_str(qdict, "arg");