OSDN Git Service

hw/ppc: Set machine->fdt in e500 machines
authorBernhard Beschow <shentey@gmail.com>
Wed, 25 Jan 2023 13:00:21 +0000 (14:00 +0100)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Sun, 5 Feb 2023 09:40:28 +0000 (06:40 -0300)
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>
hw/ppc/e500.c

index 9fa1f8e..7239993 100644 (file)
@@ -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);