diff mbox series

[v2,13/16] qmp/hmp: Expose "managed-size" for memory backends

Message ID 20200212133601.10555-14-david@redhat.com (mailing list archive)
State New, archived
Headers show
Series Ram blocks with resizable anonymous allocations under POSIX | expand

Commit Message

David Hildenbrand Feb. 12, 2020, 1:35 p.m. UTC
Expose it, and document what it means and when it was added.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 hw/core/machine-hmp-cmds.c | 2 ++
 hw/core/machine-qmp-cmds.c | 3 +++
 qapi/machine.json          | 6 ++++++
 3 files changed, 11 insertions(+)

Comments

Eric Blake Feb. 12, 2020, 2:17 p.m. UTC | #1
On 2/12/20 7:35 AM, David Hildenbrand wrote:
> Expose it, and document what it means and when it was added.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>   hw/core/machine-hmp-cmds.c | 2 ++
>   hw/core/machine-qmp-cmds.c | 3 +++
>   qapi/machine.json          | 6 ++++++
>   3 files changed, 11 insertions(+)

> +++ b/qapi/machine.json
> @@ -758,6 +758,9 @@
>   #
>   # @prealloc: enables or disables memory preallocation
>   #
> +# @managed-size: the owner manages the actual size, 'size' is an upper limit
> +#                (since 5.1)
> +#

There's still time to get this in 5.0, if the series is accepted before 
soft freeze.

>   # @host-nodes: host nodes for its memory policy
>   #
>   # @policy: memory policy of memory backend
> @@ -771,6 +774,7 @@
>       'merge':      'bool',
>       'dump':       'bool',
>       'prealloc':   'bool',
> +    'managed-size': 'bool',
>       'host-nodes': ['uint16'],
>       'policy':     'HostMemPolicy' }}
>   
> @@ -793,6 +797,7 @@
>   #          "merge": false,
>   #          "dump": true,
>   #          "prealloc": false,
> +#          "manmaged-size": false,

typo, managed-size

>   #          "host-nodes": [0, 1],
>   #          "policy": "bind"
>   #        },
> @@ -801,6 +806,7 @@
>   #          "merge": false,
>   #          "dump": true,
>   #          "prealloc": true,
> +#          "manmaged-size": false,

and again

>   #          "host-nodes": [2, 3],
>   #          "policy": "preferred"
>   #        }
>
diff mbox series

Patch

diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
index b76f7223af..681216198d 100644
--- a/hw/core/machine-hmp-cmds.c
+++ b/hw/core/machine-hmp-cmds.c
@@ -122,6 +122,8 @@  void hmp_info_memdev(Monitor *mon, const QDict *qdict)
                        m->value->dump ? "true" : "false");
         monitor_printf(mon, "  prealloc: %s\n",
                        m->value->prealloc ? "true" : "false");
+        monitor_printf(mon, "  managed-size: %s\n",
+                       m->value->managed_size ? "true" : "false");
         monitor_printf(mon, "  policy: %s\n",
                        HostMemPolicy_str(m->value->policy));
         visit_complete(v, &str);
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index eed5aeb2f7..800b55af5d 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -321,6 +321,9 @@  static int query_memdev(Object *obj, void *opaque)
         m->value->prealloc = object_property_get_bool(obj,
                                                       "prealloc",
                                                       &error_abort);
+        m->value->managed_size = object_property_get_bool(obj,
+                                                          "managed-size",
+                                                          &error_abort);
         m->value->policy = object_property_get_enum(obj,
                                                     "policy",
                                                     "HostMemPolicy",
diff --git a/qapi/machine.json b/qapi/machine.json
index b3d30bc816..0c31818853 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -758,6 +758,9 @@ 
 #
 # @prealloc: enables or disables memory preallocation
 #
+# @managed-size: the owner manages the actual size, 'size' is an upper limit
+#                (since 5.1)
+#
 # @host-nodes: host nodes for its memory policy
 #
 # @policy: memory policy of memory backend
@@ -771,6 +774,7 @@ 
     'merge':      'bool',
     'dump':       'bool',
     'prealloc':   'bool',
+    'managed-size': 'bool',
     'host-nodes': ['uint16'],
     'policy':     'HostMemPolicy' }}
 
@@ -793,6 +797,7 @@ 
 #          "merge": false,
 #          "dump": true,
 #          "prealloc": false,
+#          "manmaged-size": false,
 #          "host-nodes": [0, 1],
 #          "policy": "bind"
 #        },
@@ -801,6 +806,7 @@ 
 #          "merge": false,
 #          "dump": true,
 #          "prealloc": true,
+#          "manmaged-size": false,
 #          "host-nodes": [2, 3],
 #          "policy": "preferred"
 #        }