Message ID | 20220904233456.209027-10-danielhb413@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | QMP/HMP: introduce 'dumpdtb' | expand |
On 9/5/22 01:34, Daniel Henrique Barboza wrote: > This will enable support for the 'dumpdtb' QMP/HMP command for > all powernv machines. > > Cc: Cédric Le Goater <clg@kaod.org> > Cc: Frederic Barrat <fbarrat@linux.ibm.com> > Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Thanks, C. > --- > hw/ppc/pnv.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c > index 354aa289d1..6a20c4811f 100644 > --- a/hw/ppc/pnv.c > +++ b/hw/ppc/pnv.c > @@ -678,7 +678,13 @@ static void pnv_reset(MachineState *machine) > qemu_fdt_dumpdtb(fdt, fdt_totalsize(fdt)); > cpu_physical_memory_write(PNV_FDT_ADDR, fdt, fdt_totalsize(fdt)); > > - g_free(fdt); > + /* > + * Set machine->fdt for 'dumpdtb' QMP/HMP command. Free > + * the existing machine->fdt to avoid leaking it during > + * a reset. > + */ > + g_free(machine->fdt); > + machine->fdt = fdt; > } > > static ISABus *pnv_chip_power8_isa_create(PnvChip *chip, Error **errp)
On 05/09/2022 01:34, Daniel Henrique Barboza wrote: > This will enable support for the 'dumpdtb' QMP/HMP command for > all powernv machines. > > Cc: Cédric Le Goater <clg@kaod.org> > Cc: Frederic Barrat <fbarrat@linux.ibm.com> > Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> > --- LGTM Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com> Fred > hw/ppc/pnv.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c > index 354aa289d1..6a20c4811f 100644 > --- a/hw/ppc/pnv.c > +++ b/hw/ppc/pnv.c > @@ -678,7 +678,13 @@ static void pnv_reset(MachineState *machine) > qemu_fdt_dumpdtb(fdt, fdt_totalsize(fdt)); > cpu_physical_memory_write(PNV_FDT_ADDR, fdt, fdt_totalsize(fdt)); > > - g_free(fdt); > + /* > + * Set machine->fdt for 'dumpdtb' QMP/HMP command. Free > + * the existing machine->fdt to avoid leaking it during > + * a reset. > + */ > + g_free(machine->fdt); > + machine->fdt = fdt; > } > > static ISABus *pnv_chip_power8_isa_create(PnvChip *chip, Error **errp)
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 354aa289d1..6a20c4811f 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -678,7 +678,13 @@ static void pnv_reset(MachineState *machine) qemu_fdt_dumpdtb(fdt, fdt_totalsize(fdt)); cpu_physical_memory_write(PNV_FDT_ADDR, fdt, fdt_totalsize(fdt)); - g_free(fdt); + /* + * Set machine->fdt for 'dumpdtb' QMP/HMP command. Free + * the existing machine->fdt to avoid leaking it during + * a reset. + */ + g_free(machine->fdt); + machine->fdt = fdt; } static ISABus *pnv_chip_power8_isa_create(PnvChip *chip, Error **errp)
This will enable support for the 'dumpdtb' QMP/HMP command for all powernv machines. Cc: Cédric Le Goater <clg@kaod.org> Cc: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- hw/ppc/pnv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)