From f32f9ffcfec61face1b9a684d19f64cc2cbcd6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 12 Aug 2026 19:33:08 +0200 Subject: [PATCH] monitor: Replace container_of(MonitorHMP, parent_obj) -> MONITOR_HMP() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By replacing the container_of(MonitorHMP) use in ui/ui-hmp-cmds.c we can remove its incorrect inclusion of "monitor/monitor-internal.h" header, using the public "monitor/monitor.h" instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Message-Id: <20260812211708.92824-23-philmd@oss.qualcomm.com> --- monitor/hmp-cmds.c | 2 +- monitor/hmp.c | 2 +- ui/ui-hmp-cmds.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index bcd0a1fc87..4e8d996dbb 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -290,7 +290,7 @@ void hmp_info_sync_profile(Monitor *mon, const QDict *qdict) void hmp_info_history(Monitor *mon, const QDict *qdict) { - MonitorHMP *hmp = container_of(mon, MonitorHMP, parent_obj); + MonitorHMP *hmp = MONITOR_HMP(mon); int i; const char *str; diff --git a/monitor/hmp.c b/monitor/hmp.c index 46f8d4a6ed..22b1972d34 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -1520,7 +1520,7 @@ cleanup: static void monitor_read(void *opaque, const uint8_t *buf, int size) { Monitor *mon = opaque; - MonitorHMP *hmp = container_of(mon, MonitorHMP, parent_obj); + MonitorHMP *hmp = MONITOR_HMP(mon); int i; if (hmp->rs) { diff --git a/ui/ui-hmp-cmds.c b/ui/ui-hmp-cmds.c index 24cf3a6710..806a7bece7 100644 --- a/ui/ui-hmp-cmds.c +++ b/ui/ui-hmp-cmds.c @@ -19,7 +19,7 @@ #endif #include "monitor/hmp.h" #include "monitor/hmp-completion.h" -#include "monitor/monitor-internal.h" +#include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-ui.h" #include "qobject/qdict.h" @@ -343,7 +343,7 @@ void hmp_change_vnc(Monitor *mon, const char *device, const char *target, return; } if (!arg) { - MonitorHMP *hmp = container_of(mon, MonitorHMP, parent_obj); + MonitorHMP *hmp = MONITOR_HMP(mon); monitor_read_password(hmp, hmp_change_read_arg, NULL); } else { qmp_change_vnc_password(arg, errp);