On Thu, Jun 19, 2014 at 12:40 AM, Paolo Bonzini <pbonz...@redhat.com> wrote: > Il 18/06/2014 09:57, Peter Crosthwaite ha scritto: > >> @@ -63,7 +68,7 @@ qemu_irq qemu_allocate_irq(qemu_irq_handler handler, >> void *opaque, int n) >> { >> struct IRQState *irq; >> >> - irq = g_new(struct IRQState, 1); >> + irq = IRQ(object_new(TYPE_IRQ)); >> irq->handler = handler; >> irq->opaque = opaque; >> irq->n = n; >> @@ -82,7 +87,7 @@ void qemu_free_irqs(qemu_irq *s, int n) >> >> void qemu_free_irq(qemu_irq irq) >> { >> - g_free(irq); >> + object_unref(OBJECT(irq)); >> } >> >> static void qemu_notirq(void *opaque, int line, int level) > > > If the next step is to add an "owner" like the one in MemoryRegion, and > change occurrences of qemu_free_irq to object_unparent,
Sure, I guess its a tree wide much like the one for Memory API though. Can we do it as follow up though and sneak this through for 2.1? Regards, Peter > then > > Acked-by: Paolo Bonzini <pbonz...@redhat.com> > > Paolo >