From: Peter Xu <peterx@redhat.com>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org,
Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>,
Paolo Bonzini <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
philmd@linaro.org
Subject: Re: [PATCH 2/6] memory: Factor out common ram region initialization
Date: Wed, 24 Dec 2025 10:33:48 -0500 [thread overview]
Message-ID: <aUwH3O5fgklYuwOh@x1.local> (raw)
In-Reply-To: <c648e425d67ec3a7ebf51e40c2d149beb553569c.1766525089.git.balaton@eik.bme.hu>
On Tue, Dec 23, 2025 at 10:49:58PM +0100, BALATON Zoltan wrote:
> -bool memory_region_init_ram_nomigrate(MemoryRegion *mr,
> - Object *owner,
> - const char *name,
> - uint64_t size,
> - Error **errp)
> -{
> - return memory_region_init_ram_flags_nomigrate(mr, owner, name,
> - size, 0, errp);
> -}
> -
> -bool memory_region_init_ram_flags_nomigrate(MemoryRegion *mr,
> - Object *owner,
> - const char *name,
> - uint64_t size,
> - uint32_t ram_flags,
> - Error **errp)
> +static bool memory_region_do_init_ram(MemoryRegion *mr,
> + Error *err, Error **errp)
> {
> - Error *err = NULL;
> - memory_region_init(mr, owner, name, size);
> mr->ram = true;
> mr->terminates = true;
> mr->destructor = memory_region_destructor_ram;
> - mr->ram_block = qemu_ram_alloc(size, ram_flags, mr, &err);
If this is moved out, the err below will never be set. Maybe this helper
then doesn't need errp at all.
> if (err) {
> mr->size = int128_zero();
> object_unparent(OBJECT(mr));
> @@ -1611,6 +1594,25 @@ bool memory_region_init_ram_flags_nomigrate(MemoryRegion *mr,
> return true;
> }
--
Peter Xu
next prev parent reply other threads:[~2025-12-24 15:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 21:49 [PATCH 0/6] Implement memory_region_new_* functions BALATON Zoltan
2025-12-23 21:49 ` [PATCH 1/6] memory: Add internal memory_region_set_ops helper function BALATON Zoltan
2025-12-23 21:49 ` [PATCH 2/6] memory: Factor out common ram region initialization BALATON Zoltan
2025-12-24 15:33 ` Peter Xu [this message]
2026-01-25 20:19 ` BALATON Zoltan
2025-12-23 21:49 ` [PATCH 3/6] memory: Factor out more " BALATON Zoltan
2025-12-26 11:31 ` Philippe Mathieu-Daudé
2025-12-23 21:50 ` [PATCH 4/6] memory: Shorten memory_region_init_rom_nomigrate BALATON Zoltan
2025-12-23 21:50 ` [PATCH 5/6] memory: Add internal memory_region_register_ram function BALATON Zoltan
2025-12-26 11:32 ` Philippe Mathieu-Daudé
2025-12-23 21:50 ` [PATCH 6/6] memory: Add memory_region_new* functions BALATON Zoltan
2025-12-24 5:21 ` [PATCH 0/6] Implement memory_region_new_* functions Akihiko Odaki
2025-12-24 13:47 ` BALATON Zoltan
2025-12-24 15:36 ` Peter Xu
2025-12-25 5:22 ` Akihiko Odaki
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=aUwH3O5fgklYuwOh@x1.local \
--to=peterx@redhat.com \
--cc=balaton@eik.bme.hu \
--cc=mst@redhat.com \
--cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
--cc=pbonzini@redhat.com \
--cc=philmd@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.