summary refs log tree commit diff stats
path: root/hw/ppc
diff options
context:
space:
mode:
authorBernhard Beschow <shentey@gmail.com>2023-01-25 14:00:21 +0100
committerDaniel Henrique Barboza <danielhb413@gmail.com>2023-02-05 06:40:28 -0300
commit891d51be6fb82383f21e20b25b2bd1487c57eef9 (patch)
tree6239fcb9bad991b9711ffa2ecf2f4b94d4395726 /hw/ppc
parent3f736ca9b2d66e881bee5083655fc8c208d05299 (diff)
downloadfocaccia-qemu-891d51be6fb82383f21e20b25b2bd1487c57eef9.tar.gz
focaccia-qemu-891d51be6fb82383f21e20b25b2bd1487c57eef9.zip
hw/ppc: Set machine->fdt in e500 machines
This enables support for the 'dumpdtb' QMP/HMP command for all
e500 machines.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20230125130024.158721-2-shentey@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/e500.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 9fa1f8e6cf..7239993acc 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -659,9 +659,14 @@ done:
     if (!dry_run) {
         qemu_fdt_dumpdtb(fdt, fdt_size);
         cpu_physical_memory_write(addr, fdt, fdt_size);
+
+        /* Set machine->fdt for 'dumpdtb' QMP/HMP command */
+        g_free(machine->fdt);
+        machine->fdt = fdt;
+    } else {
+        g_free(fdt);
     }
     ret = fdt_size;
-    g_free(fdt);
 
 out:
     g_free(pci_map);