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:
Igor Mammedov 2017-01-10 13:53:15 +01:00 committed by Eduardo Habkost
parent 3a4641054e
commit e1ff3c67e8
7 changed files with 41 additions and 4 deletions

View file

@ -3529,6 +3529,7 @@ Example (1):
"policy": "bind"
},
{
"id": "mem1",
"size": 536870912,
"merge": false,
"dump": true,