[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 1/6] memory: address_space_init: do nothing if no
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [PATCH v1 1/6] memory: address_space_init: do nothing if no root region given |
Date: |
Mon, 25 Aug 2014 17:56:57 -0700 |
Just ignore this case. This is needed for bus master device realize
when the machine model doesn't connect an attachment. Then machine
model may decide to not set a memory region for mastering yet the
device will attempt to create itself an address space come realize
time. Gracefully do nothing.
Signed-off-by: Peter Crosthwaite <address@hidden>
---
memory.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/memory.c b/memory.c
index 42317a2..e6014d9 100644
--- a/memory.c
+++ b/memory.c
@@ -1925,6 +1925,10 @@ void address_space_init(AddressSpace *as, MemoryRegion
*root, const char *name)
memory_init();
}
+ if (!root) {
+ return;
+ }
+
memory_region_transaction_begin();
as->root = root;
as->current_map = g_new(FlatView, 1);
--
2.1.0.1.g27b9230