On Tue, Dec 24, 2024 at 08:16:48AM -0800, Steve Sistare wrote:
@@ -2079,6 +2100,41 @@ RAMBlock *qemu_ram_alloc_internal(ram_addr_t size,
ram_addr_t max_size,
assert((ram_flags & ~(RAM_SHARED | RAM_RESIZEABLE | RAM_PREALLOC |
RAM_NORESERVE | RAM_GUEST_MEMFD)) == 0);
assert(!host ^ (ram_flags & RAM_PREALLOC));
+ assert(max_size >= size);
+
+#ifdef CONFIG_POSIX /* ignore RAM_SHARED for Windows */
Yeh relying on POSIX should also be ok..
+ if (!host) {
+ if (ram_flags & RAM_SHARED) {
Nitpick: can merge the two "if"s.