Skip to content

Commit 15a9fe6

Browse files
shenkiphilmd
authored andcommitted
hw/core/machine: Fix -machine dumpdtb=file.dtb
In commit 8fd2518 ("hw: Centralize handling of -machine dumpdtb option") the call to dump was moved with respect to the init of the machine. This resulted in the device tree missing parts of the machine description, depending on how they construct their device tree. The arm virt machine is missing some PSCI nodes, while the riscv one is missing most of its content. Move the dump to after the notifiers have been run, allowing virt_machine_done to be called and the device tree to be fully populated. Fixes: 8fd2518 ("hw: Centralize handling of -machine dumpdtb option") Signed-off-by: Joel Stanley <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
1 parent a7a05f5 commit 15a9fe6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

hw/core/machine.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,12 +1731,6 @@ void qdev_machine_creation_done(void)
17311731
phase_advance(PHASE_MACHINE_READY);
17321732
qdev_assert_realized_properly();
17331733

1734-
/*
1735-
* If the user used -machine dumpdtb=file.dtb to request that we
1736-
* dump the DTB to a file, do it now, and exit.
1737-
*/
1738-
handle_machine_dumpdtb(current_machine);
1739-
17401734
/* TODO: once all bus devices are qdevified, this should be done
17411735
* when bus is created by qdev.c */
17421736
/*
@@ -1750,6 +1744,12 @@ void qdev_machine_creation_done(void)
17501744

17511745
notifier_list_notify(&machine_init_done_notifiers, NULL);
17521746

1747+
/*
1748+
* If the user used -machine dumpdtb=file.dtb to request that we
1749+
* dump the DTB to a file, do it now, and exit.
1750+
*/
1751+
handle_machine_dumpdtb(current_machine);
1752+
17531753
if (rom_check_and_register_reset() != 0) {
17541754
exit(1);
17551755
}

0 commit comments

Comments
 (0)