Hi, In this new version we have changes based on review comments from v3.
I've also added a new patch (21) that adds an extra parameter called 'textformat' to the dumpdtb QMP command. Using this parameter will write the FDT in text format, using DTS compatible formatting like the 'info fdt' command is already using. This will allow users to see the FDT contents in a text file without the need of decoding the blob using 'dtc': (qemu) dumpdtb -t fdt.txt $ file fdt.txt fdt.txt: ASCII text, with very long lines (4746) $ grep -A 3 'persistent-memory' fdt.txt ibm,persistent-memory { device_type = "ibm,persistent-memory"; #size-cells = <0x0>; #address-cells = <0x1>; }; Changes from v3: - patch 10: - clarified in the commit message that, in the current code base, the spapr internal FDT won't always match what the guest is using - patch 14: - changed 'filename' to type F - use 'hmp_handle_error' instead of 'error_report_err' - patch 15: - added a semi-colon at the end of each closing bracket - patch 16: - added an extra space after each individual string in the string array - patch 20: - fixed commit msg with the actual output of 'info fdt' - patch 21 (NEW): - added a '-t' parameter to 'dumpdtb' to create a FDT file in plain text format, using the same formatting we already implemented with 'info fdt' - v3 link: https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg02419.html Daniel Henrique Barboza (21): hw/arm: do not free machine->fdt in arm_load_dtb() hw/microblaze: set machine->fdt in microblaze_load_dtb() hw/nios2: set machine->fdt in nios2_load_dtb() hw/ppc: set machine->fdt in ppce500_load_device_tree() hw/ppc: set machine->fdt in bamboo_load_device_tree() hw/ppc: set machine->fdt in sam460ex_load_device_tree() hw/ppc: set machine->fdt in xilinx_load_device_tree() hw/ppc: set machine->fdt in pegasos2_machine_reset() hw/ppc: set machine->fdt in pnv_reset() hw/ppc: set machine->fdt in spapr machine hw/riscv: set machine->fdt in sifive_u_machine_init() hw/riscv: set machine->fdt in spike_board_init() hw/xtensa: set machine->fdt in xtfpga_init() qmp/hmp, device_tree.c: introduce dumpdtb qmp/hmp, device_tree.c: introduce 'info fdt' command device_tree.c: support string array prop in fdt_format_node() device_tree.c: support remaining FDT prop types device_node.c: enable 'info fdt' to print subnodes device_tree.c: add fdt_format_property() helper hmp, device_tree.c: add 'info fdt <property>' support qmp/hmp, device_tree.c: add textformat dumpdtb option hmp-commands-info.hx | 14 +++ hmp-commands.hx | 14 +++ hw/arm/boot.c | 6 +- hw/microblaze/boot.c | 11 +- hw/microblaze/meson.build | 2 +- hw/nios2/boot.c | 11 +- hw/nios2/meson.build | 2 +- hw/ppc/e500.c | 13 +- hw/ppc/pegasos2.c | 7 ++ hw/ppc/pnv.c | 8 +- hw/ppc/ppc440_bamboo.c | 11 +- hw/ppc/sam460ex.c | 8 +- hw/ppc/spapr.c | 6 + hw/ppc/spapr_hcall.c | 8 ++ hw/ppc/virtex_ml507.c | 11 +- hw/riscv/sifive_u.c | 6 + hw/riscv/spike.c | 9 ++ hw/xtensa/meson.build | 2 +- hw/xtensa/xtfpga.c | 9 +- include/monitor/hmp.h | 2 + include/sysemu/device_tree.h | 8 ++ monitor/hmp-cmds.c | 29 +++++ monitor/qmp-cmds.c | 29 +++++ qapi/machine.json | 38 ++++++ softmmu/device_tree.c | 238 +++++++++++++++++++++++++++++++++++ 25 files changed, 490 insertions(+), 12 deletions(-) -- 2.37.2