[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/45] qmp: Include "reserve" property of memory backends
From: |
Paolo Bonzini |
Subject: |
[PULL 31/45] qmp: Include "reserve" property of memory backends |
Date: |
Thu, 17 Jun 2021 11:31:20 +0200 |
From: David Hildenbrand <david@redhat.com>
Let's include the new property. Instead of relying on CONFIG_LINUX,
let's try to unconditionally grab the property and treat errors as
"does not exist".
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-15-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/core/machine-qmp-cmds.c | 7 +++++++
qapi/machine.json | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index a36ceaf4f3..216fdfaf3a 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -157,6 +157,7 @@ void qmp_set_numa_node(NumaOptions *cmd, Error **errp)
static int query_memdev(Object *obj, void *opaque)
{
+ Error *err = NULL;
MemdevList **list = opaque;
Memdev *m;
QObject *host_nodes;
@@ -173,6 +174,12 @@ static int query_memdev(Object *obj, void *opaque)
m->dump = object_property_get_bool(obj, "dump", &error_abort);
m->prealloc = object_property_get_bool(obj, "prealloc", &error_abort);
m->share = object_property_get_bool(obj, "share", &error_abort);
+ m->reserve = object_property_get_bool(obj, "reserve", &err);
+ if (err) {
+ error_free_or_abort(&err);
+ } else {
+ m->has_reserve = true;
+ }
m->policy = object_property_get_enum(obj, "policy", "HostMemPolicy",
&error_abort);
host_nodes = object_property_get_qobject(obj,
diff --git a/qapi/machine.json b/qapi/machine.json
index 1395742a4a..e4d0f9b24f 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -798,6 +798,12 @@
#
# @share: whether memory is private to QEMU or shared (since 6.1)
#
+# @reserve: whether swap space (or huge pages) was reserved if applicable.
+# This corresponds to the user configuration and not the actual
+# behavior implemented in the OS to perform the reservation.
+# For example, Linux will never reserve swap space for shared
+# file mappings. (since 6.1)
+#
# @host-nodes: host nodes for its memory policy
#
# @policy: memory policy of memory backend
@@ -812,6 +818,7 @@
'dump': 'bool',
'prealloc': 'bool',
'share': 'bool',
+ '*reserve': 'bool',
'host-nodes': ['uint16'],
'policy': 'HostMemPolicy' }}
--
2.31.1
- [PULL 25/45] memory: Introduce RAM_NORESERVE and wire it up in qemu_ram_mmap(), (continued)
- [PULL 25/45] memory: Introduce RAM_NORESERVE and wire it up in qemu_ram_mmap(), Paolo Bonzini, 2021/06/17
- [PULL 24/45] util/mmap-alloc: Pass flags instead of separate bools to qemu_ram_mmap(), Paolo Bonzini, 2021/06/17
- [PULL 27/45] hostmem: Wire up RAM_NORESERVE via "reserve" property, Paolo Bonzini, 2021/06/17
- [PULL 28/45] qmp: Clarify memory backend properties returned via query-memdev, Paolo Bonzini, 2021/06/17
- [PULL 30/45] hmp: Print "share" property of memory backends with "info memdev", Paolo Bonzini, 2021/06/17
- [PULL 35/45] target/i386: Added consistency checks for VMRUN intercept and ASID, Paolo Bonzini, 2021/06/17
- [PULL 34/45] target/i386: Refactored intercept checks into cpu_svm_has_intercept, Paolo Bonzini, 2021/06/17
- [PULL 39/45] softfloat: Use _Generic instead of QEMU_GENERIC, Paolo Bonzini, 2021/06/17
- [PULL 41/45] util: Pass file+line to qemu_rec_mutex_unlock_impl, Paolo Bonzini, 2021/06/17
- [PULL 32/45] hmp: Print "reserve" property of memory backends with "info memdev", Paolo Bonzini, 2021/06/17
- [PULL 31/45] qmp: Include "reserve" property of memory backends,
Paolo Bonzini <=
- [PULL 45/45] configure: Remove probe for _Static_assert, Paolo Bonzini, 2021/06/17
- Re: [PULL 00/45] Memory, i386, compilation, bugfix changes for 2021-06-17, no-reply, 2021/06/17
- Re: [PULL 00/45] Memory, i386, compilation, bugfix changes for 2021-06-17, Peter Maydell, 2021/06/18