[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices |
Date: |
Mon, 25 May 2020 10:26:37 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 25/05/20 09:01, Markus Armbruster wrote:
>> Just remembered that we fail creating the machine and therefore abort. So
>> not necessary :)
> True.
>
> But let's review briefly what happens when a realize method fails.
>
> In theory, realize fails cleanly, i.e. doing nothing. Another attempt
> could be made then.
>
> In practice, realize failure is always followed by destruction, unless
> preempted by outright exit(1).
>
> Destroying a device must also destroy its components.
>
> Paolo, is destroying a realized device okay, or does it have to be
> unrealized first? I can't see automatic unrealize on destruction...
It cannot happen, because a device must be unparented before it's
destroyed and unparenting takes care of unrealizing the device. So the
stageobject lifetime should always proceed in this order:
created
created, with parent
created, with parent, with bus (if applicable)
realizing
realized
unrealizing
unrealized
unrealized, without parent, with bus (if applicable)
unrealized, without parent, without bus
finalizing (without references)
finalized
freed
Where the second and third would be fixed by moving /machine/unattached
from device_set_realized to qdev_realize.
Paolo
- [PATCH 55/55] MAINTAINERS: Make section QOM cover hw/core/*bus.c as well, (continued)
- [PATCH 55/55] MAINTAINERS: Make section QOM cover hw/core/*bus.c as well, Markus Armbruster, 2020/05/19
- [PATCH 21/55] ssi: ssi_auto_connect_slaves() never does anything, drop, Markus Armbruster, 2020/05/19
- [PATCH 29/55] qdev: qdev_create(), qdev_try_create() are now unused, drop, Markus Armbruster, 2020/05/19
- [PATCH 46/55] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 2, Markus Armbruster, 2020/05/19
- [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices, Markus Armbruster, 2020/05/19
- Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices, David Hildenbrand, 2020/05/20
- Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices, David Hildenbrand, 2020/05/21
- Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices, Markus Armbruster, 2020/05/25
- Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices,
Paolo Bonzini <=
- Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices, Markus Armbruster, 2020/05/26
- Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices, Paolo Bonzini, 2020/05/26
- Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices, Markus Armbruster, 2020/05/26
- Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices, Markus Armbruster, 2020/05/29
Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices, Cornelia Huck, 2020/05/26
Re: [PATCH 50/55] s390x/event-facility: Simplify creation of SCLP event devices, David Hildenbrand, 2020/05/26
Re: [PATCH 00/55] qdev: Rework how we plug into the parent bus, Paolo Bonzini, 2020/05/20