On Wed, Dec 23, 2015 at 03:43:21PM +0800, Li Zhijian wrote: > Cc: David Gibson <da...@gibson.dropbear.id.au> > Cc: Alexander Graf <ag...@suse.de> > Cc: qemu-...@nongnu.org > Signed-off-by: Li Zhijian <lizhij...@cn.fujitsu.com>
Since the machine has a lifetime basically equal to the runtime of qemu, it's not a terribly important leak. Still, might as well get it right. Merged into my ppc-for-2.6 branch. > --- > hw/ppc/spapr.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 6bfb908..65b2d61 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -2101,6 +2101,13 @@ static void spapr_machine_initfn(Object *obj) > NULL); > } > > +static char *spapr_machine_finalizefn(Object *obj) > +{ > + sPAPRMachineState *spapr = SPAPR_MACHINE(obj); > + > + g_free(spapr->kvm_type); > +} > + > static void ppc_cpu_do_nmi_on_cpu(void *arg) > { > CPUState *cs = arg; > @@ -2288,6 +2295,7 @@ static const TypeInfo spapr_machine_info = { > .abstract = true, > .instance_size = sizeof(sPAPRMachineState), > .instance_init = spapr_machine_initfn, > + .instance_finalize = spapr_machine_finalizefn, > .class_size = sizeof(sPAPRMachineClass), > .class_init = spapr_machine_class_init, > .interfaces = (InterfaceInfo[]) { -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature