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, then
Acked-by: Paolo Bonzini <pbonz...@redhat.com>
Paolo