qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.4 1/2] core: reset handler for bus-less de


From: Peter Crosthwaite
Subject: Re: [Qemu-devel] [PATCH for-2.4 1/2] core: reset handler for bus-less devices
Date: Thu, 9 Jul 2015 11:53:17 -0700

On Thu, Jul 9, 2015 at 9:59 AM, Andreas Färber <address@hidden> wrote:
> Am 09.07.2015 um 18:51 schrieb Cornelia Huck:
>> Devices that don't live on a bus aren't caught by the normal device
>> reset logic. Let's register a reset handler for those devices during
>> device realization that calls the reset handler for the associated
>> device class.
>>
>> Suggested-by: Peter Crosthwaite <address@hidden>
>> Signed-off-by: Cornelia Huck <address@hidden>
>> ---
>>  hw/core/qdev.c | 15 +++++++++++++++
>>  1 file changed, 15 insertions(+)
>
> Looks acceptable as solution for 2.4... However, I would like to
> understand why the parent device cannot reset it? Someone created that
> device in the first place. I would prefer you call device_reset() from
> there without this generic patch.
>

So it is entirely possible for a device to be completely orphaned if
it neither fits in a bus or a container. In that case I guess the
container would be /machine. Particularly tricky for hotplug
scenarios. I don't think we wan't concrete-class containers having to
do explicit child resets and any generalization of that in TYPE_DEVICE
is not too far removed from this patch.

Any reason to not just rip though the whole QOM tree and reset every
device regardless of bus/containuer arch? IIRC the semantics for
->reset (and at least devices_reset()) are "pull the plug out of wall
and put it back in again" so there is currently supposed to be no
scope for controlling reset events.

This is a good lower risk solution that handled to obvious degenerate
case of orphaned devices.

Reviewed-by: Peter Crosthwaite <address@hidden>

Regards,
Peter

> A similar discussion took place for the x86 APIC.
>
> Regards,
> Andreas
>
> --
> SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB
> 21284 (AG Nürnberg)
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]