monitor: Replace container_of(MonitorHMP, parent_obj) -> MONITOR_HMP()

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é <philmd@oss.qualcomm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260812211708.92824-23-philmd@oss.qualcomm.com>
This commit is contained in:
Philippe Mathieu-Daudé 2026-08-12 19:33:08 +02:00
parent e33c5ac0d8
commit f32f9ffcfe
3 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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) {

View file

@ -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);