qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Alexey Kardashevskiy" <aik@ozlabs.ru>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"KONRAD Frederic" <frederic.konrad@adacore.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Peter Maydell" <peter.maydell@linaro.org>
Subject: [PATCH-for-6.1 v3 4/5] memory: Add setter for MemoryRegion object 'size' property
Date: Sat, 27 Mar 2021 15:34:51 +0100	[thread overview]
Message-ID: <20210327143452.1514392-5-f4bug@amsat.org> (raw)
In-Reply-To: <20210327143452.1514392-1-f4bug@amsat.org>

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 softmmu/memory.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/softmmu/memory.c b/softmmu/memory.c
index 3f4cd4e85d7..1a5b8a62eb9 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -1237,6 +1237,18 @@ static void memory_region_size_getter(Object *obj, Visitor *v,
     visit_type_uint64(v, name, &value, errp);
 }
 
+static void memory_region_size_setter(Object *obj, Visitor *v,
+                                      const char *name, void *opaque,
+                                      Error **errp)
+{
+    MemoryRegion *mr = MEMORY_REGION(obj);
+    uint64_t size;
+
+    if (visit_type_uint64(v, name, &size, errp)) {
+        memory_region_set_size(mr, size);
+    }
+}
+
 static void memory_region_initfn(Object *obj)
 {
     MemoryRegion *mr = MEMORY_REGION(obj);
@@ -1264,7 +1276,7 @@ static void memory_region_initfn(Object *obj)
                         NULL, NULL);
     object_property_add(OBJECT(mr), "size", "uint64",
                         memory_region_size_getter,
-                        NULL, /* memory_region_size_setter, */
+                        memory_region_size_setter,
                         NULL, NULL);
 }
 
-- 
2.26.2



  parent reply	other threads:[~2021-03-27 14:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-27 14:34 [PATCH v3 0/5] memory: Add 'priority' property setter Philippe Mathieu-Daudé
2021-03-27 14:34 ` [PATCH-for-6.0 v3 1/5] memory: Fix memory_region 'priority' property sign Philippe Mathieu-Daudé
2021-03-27 14:34 ` [PATCH-for-6.1 v3 2/5] memory: Add memory_region_set_priority() Philippe Mathieu-Daudé
2021-03-27 14:34 ` [PATCH-for-6.1 v3 3/5] memory: Rename MemoryRegion object getters Philippe Mathieu-Daudé
2021-03-27 14:34 ` Philippe Mathieu-Daudé [this message]
2021-03-27 14:34 ` [PATCH-for-6.1 v3 5/5] memory: Add setter for MemoryRegion object 'priority' property Philippe Mathieu-Daudé
2021-03-27 16:58 ` [PATCH v3 0/5] memory: Add 'priority' property setter Peter Maydell
2021-03-27 18:44   ` Philippe Mathieu-Daudé
2021-03-27 19:43     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210327143452.1514392-5-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=aik@ozlabs.ru \
    --cc=frederic.konrad@adacore.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).