mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
monitor: fix qmp/hmp query-memdev not reporting IDs of memory backends
Considering 'id' is mandatory for user_creatable objects/backends and user_creatable_add_type() always has it as an argument regardless of where from it is called CLI/monitor or QMP, Fix issue by adding 'id' property to hostmem backends and set it in user_creatable_add_type() for every object that implements 'id' property. Then later at query-memdev time get 'id' from object directly. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <1484052795-158195-4-git-send-email-imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
3a4641054e
commit
e1ff3c67e8
7 changed files with 41 additions and 4 deletions
5
hmp.c
5
hmp.c
|
|
@ -2078,13 +2078,11 @@ void hmp_info_memdev(Monitor *mon, const QDict *qdict)
|
|||
MemdevList *m = memdev_list;
|
||||
Visitor *v;
|
||||
char *str;
|
||||
int i = 0;
|
||||
|
||||
|
||||
while (m) {
|
||||
v = string_output_visitor_new(false, &str);
|
||||
visit_type_uint16List(v, NULL, &m->value->host_nodes, NULL);
|
||||
monitor_printf(mon, "memory backend: %d\n", i);
|
||||
monitor_printf(mon, "memory backend: %s\n", m->value->id);
|
||||
monitor_printf(mon, " size: %" PRId64 "\n", m->value->size);
|
||||
monitor_printf(mon, " merge: %s\n",
|
||||
m->value->merge ? "true" : "false");
|
||||
|
|
@ -2100,7 +2098,6 @@ void hmp_info_memdev(Monitor *mon, const QDict *qdict)
|
|||
g_free(str);
|
||||
visit_free(v);
|
||||
m = m->next;
|
||||
i++;
|
||||
}
|
||||
|
||||
monitor_printf(mon, "\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue