qmp: Include "share" property of memory backends

Let's include the property, which can be helpful when debugging,
for example, to spot misuse of MAP_PRIVATE which can result in some ugly
corner cases (e.g., double-memory consumption on shmem).

Use the same description we also use for describing the property.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com> for memory backend and machine core
Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210510114328.21835-13-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
David Hildenbrand 2021-05-10 13:43:25 +02:00 committed by Paolo Bonzini
parent 157cfaf9b2
commit d300fc54a4
2 changed files with 4 additions and 0 deletions

View File

@ -172,6 +172,7 @@ static int query_memdev(Object *obj, void *opaque)
m->merge = object_property_get_bool(obj, "merge", &error_abort); m->merge = object_property_get_bool(obj, "merge", &error_abort);
m->dump = object_property_get_bool(obj, "dump", &error_abort); m->dump = object_property_get_bool(obj, "dump", &error_abort);
m->prealloc = object_property_get_bool(obj, "prealloc", &error_abort); m->prealloc = object_property_get_bool(obj, "prealloc", &error_abort);
m->share = object_property_get_bool(obj, "share", &error_abort);
m->policy = object_property_get_enum(obj, "policy", "HostMemPolicy", m->policy = object_property_get_enum(obj, "policy", "HostMemPolicy",
&error_abort); &error_abort);
host_nodes = object_property_get_qobject(obj, host_nodes = object_property_get_qobject(obj,

View File

@ -796,6 +796,8 @@
# #
# @prealloc: whether memory was preallocated # @prealloc: whether memory was preallocated
# #
# @share: whether memory is private to QEMU or shared (since 6.1)
#
# @host-nodes: host nodes for its memory policy # @host-nodes: host nodes for its memory policy
# #
# @policy: memory policy of memory backend # @policy: memory policy of memory backend
@ -809,6 +811,7 @@
'merge': 'bool', 'merge': 'bool',
'dump': 'bool', 'dump': 'bool',
'prealloc': 'bool', 'prealloc': 'bool',
'share': 'bool',
'host-nodes': ['uint16'], 'host-nodes': ['uint16'],
'policy': 'HostMemPolicy' }} 'policy': 'HostMemPolicy' }}