Re: [PATCH 51/55] qdev: Make qdev_realize() support bus-less devices

2020-05-26 Thread Paolo Bonzini
On 26/05/20 07:14, Markus Armbruster wrote: >>> The contract must specify exactly what happens to the reference count, >>> case by case. >> >> For both qdev_realize and qdev_realize_and_unref, on return the caller >> need not care about keeping alive the device in the long-term. >> >> For qdev_real

Re: [PATCH 51/55] qdev: Make qdev_realize() support bus-less devices

2020-05-25 Thread Markus Armbruster
Paolo Bonzini writes: > On 25/05/20 08:38, Markus Armbruster wrote: >> Paolo Bonzini writes: >> >>> On 20/05/20 17:02, Markus Armbruster wrote: >> >> qdev_realize_and_unref() remains restricted, because its reference >> counting would become rather confusing for bus-less devices. >>

Re: [PATCH 51/55] qdev: Make qdev_realize() support bus-less devices

2020-05-25 Thread Paolo Bonzini
On 25/05/20 08:38, Markus Armbruster wrote: > Paolo Bonzini writes: > >> On 20/05/20 17:02, Markus Armbruster wrote: > > qdev_realize_and_unref() remains restricted, because its reference > counting would become rather confusing for bus-less devices. I think it would be fine, you

Re: [PATCH 51/55] qdev: Make qdev_realize() support bus-less devices

2020-05-24 Thread Markus Armbruster
Paolo Bonzini writes: > On 20/05/20 17:02, Markus Armbruster wrote: qdev_realize_and_unref() remains restricted, because its reference counting would become rather confusing for bus-less devices. >>> I think it would be fine, you would just rely on the reference held by >>> the QOM

Re: [PATCH 51/55] qdev: Make qdev_realize() support bus-less devices

2020-05-20 Thread Paolo Bonzini
On 20/05/20 17:02, Markus Armbruster wrote: >>> >>> qdev_realize_and_unref() remains restricted, because its reference >>> counting would become rather confusing for bus-less devices. >> I think it would be fine, you would just rely on the reference held by >> the QOM parent (via the child property

Re: [PATCH 51/55] qdev: Make qdev_realize() support bus-less devices

2020-05-20 Thread Markus Armbruster
Paolo Bonzini writes: > On 19/05/20 16:55, Markus Armbruster wrote: >> So far, qdev_realize() supports only devices that plug into a bus: >> argument @bus cannot be null. Extend it to support bus-less devices, >> too. >> >> qdev_realize_and_unref() remains restricted, because its reference >> c

Re: [PATCH 51/55] qdev: Make qdev_realize() support bus-less devices

2020-05-19 Thread Paolo Bonzini
On 19/05/20 16:55, Markus Armbruster wrote: > So far, qdev_realize() supports only devices that plug into a bus: > argument @bus cannot be null. Extend it to support bus-less devices, > too. > > qdev_realize_and_unref() remains restricted, because its reference > counting would become rather conf

[PATCH 51/55] qdev: Make qdev_realize() support bus-less devices

2020-05-19 Thread Markus Armbruster
So far, qdev_realize() supports only devices that plug into a bus: argument @bus cannot be null. Extend it to support bus-less devices, too. qdev_realize_and_unref() remains restricted, because its reference counting would become rather confusing for bus-less devices. Signed-off-by: Markus Armbr