Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Paolo Bonzini
On 01/31/2012 05:47 PM, Anthony Liguori wrote: static void object_initialize(Object *obj) { PIIX3State *s = PIIX3(obj); ChildProperty props[] = { { "pic[0]", TYPE_I8259, &s->pic[0] }, { "pic[1]", TYPE_I8259, &s->pic[1] }, }; object_property_add_children(obj,

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Jan Kiszka
On 2012-01-31 17:49, Anthony Liguori wrote: > On 01/31/2012 10:42 AM, Jan Kiszka wrote: >> On 2012-01-31 15:56, Anthony Liguori wrote: >>> On 01/31/2012 08:51 AM, Jan Kiszka wrote: On 2012-01-31 15:47, Anthony Liguori wrote: > On 01/31/2012 08:34 AM, Jan Kiszka wrote: >> On 2012-01-26

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Anthony Liguori
On 01/31/2012 10:42 AM, Jan Kiszka wrote: On 2012-01-31 15:56, Anthony Liguori wrote: On 01/31/2012 08:51 AM, Jan Kiszka wrote: On 2012-01-31 15:47, Anthony Liguori wrote: On 01/31/2012 08:34 AM, Jan Kiszka wrote: On 2012-01-26 20:00, Anthony Liguori wrote: @@ -548,6 +550,13 @@ static int pi

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Anthony Liguori
On 01/31/2012 10:19 AM, Jan Kiszka wrote: On 2012-01-31 17:12, Anthony Liguori wrote: On 01/31/2012 08:58 AM, Paolo Bonzini wrote: On 01/31/2012 03:51 PM, Jan Kiszka wrote: BTW, this is yet another benefit of making structures public. You can take the address of a child and set link fields di

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Jan Kiszka
On 2012-01-31 15:56, Anthony Liguori wrote: > On 01/31/2012 08:51 AM, Jan Kiszka wrote: >> On 2012-01-31 15:47, Anthony Liguori wrote: >>> On 01/31/2012 08:34 AM, Jan Kiszka wrote: On 2012-01-26 20:00, Anthony Liguori wrote: > @@ -548,6 +550,13 @@ static int piix3_realize(PCIDevice *dev) >

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Jan Kiszka
On 2012-01-31 17:12, Anthony Liguori wrote: > On 01/31/2012 08:58 AM, Paolo Bonzini wrote: >> On 01/31/2012 03:51 PM, Jan Kiszka wrote: > > BTW, this is yet another benefit of making structures public. You can > take the > address of a child and set link fields directly without acc

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Anthony Liguori
On 01/31/2012 08:58 AM, Paolo Bonzini wrote: On 01/31/2012 03:51 PM, Jan Kiszka wrote: > > BTW, this is yet another benefit of making structures public. You can take the > address of a child and set link fields directly without accessors. Well, that has two sides. We introduced properties to av

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Jan Kiszka
On 2012-01-31 15:58, Paolo Bonzini wrote: > On 01/31/2012 03:51 PM, Jan Kiszka wrote: BTW, this is yet another benefit of making structures public. You can take the address of a child and set link fields directly without accessors. >> Well, that has two sides. We introduced

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Paolo Bonzini
On 01/31/2012 03:51 PM, Jan Kiszka wrote: > > BTW, this is yet another benefit of making structures public. You can take the > address of a child and set link fields directly without accessors. Well, that has two sides. We introduced properties to avoid this direct messing. Does linking als

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Anthony Liguori
On 01/31/2012 08:51 AM, Jan Kiszka wrote: On 2012-01-31 15:47, Anthony Liguori wrote: On 01/31/2012 08:34 AM, Jan Kiszka wrote: On 2012-01-26 20:00, Anthony Liguori wrote: @@ -548,6 +550,13 @@ static int piix3_realize(PCIDevice *dev) /* Setup the RTC IRQ */ s->rtc.irq = rtc_irq;

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Jan Kiszka
On 2012-01-31 15:47, Anthony Liguori wrote: > On 01/31/2012 08:34 AM, Jan Kiszka wrote: >> On 2012-01-26 20:00, Anthony Liguori wrote: >>> @@ -548,6 +550,13 @@ static int piix3_realize(PCIDevice *dev) >>> /* Setup the RTC IRQ */ >>> s->rtc.irq = rtc_irq; >>> >>> +/* Realize the PIT

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Anthony Liguori
On 01/31/2012 08:34 AM, Jan Kiszka wrote: On 2012-01-26 20:00, Anthony Liguori wrote: @@ -548,6 +550,13 @@ static int piix3_realize(PCIDevice *dev) /* Setup the RTC IRQ */ s->rtc.irq = rtc_irq; +/* Realize the PIT */ +qdev_set_parent_bus(DEVICE(&s->pit), BUS(s->bus)); +q

Re: [Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-31 Thread Jan Kiszka
On 2012-01-26 20:00, Anthony Liguori wrote: > @@ -548,6 +550,13 @@ static int piix3_realize(PCIDevice *dev) > /* Setup the RTC IRQ */ > s->rtc.irq = rtc_irq; > > +/* Realize the PIT */ > +qdev_set_parent_bus(DEVICE(&s->pit), BUS(s->bus)); > +qdev_init_nofail(DEVICE(&s->pit))

[Qemu-devel] [PATCH 06/15] piix: create i8254 through composition

2012-01-26 Thread Anthony Liguori
Signed-off-by: Anthony Liguori --- hw/i8254.c| 35 +++ hw/i8254.h| 38 ++ hw/pc.c |5 + hw/piix_pci.c | 15 ++- 4 files changed, 56 insertions(+), 37 deletions(-) create mode 100644 hw/i82