[Top][All Lists]

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

qom device lifecycle interaction with hotplug/hotunplug ?

From: Peter Maydell
Subject: qom device lifecycle interaction with hotplug/hotunplug ?
Date: Thu, 28 Nov 2019 16:00:06 +0000

Hi; this is a question which came up in Damien's reset series
which I don't know the answer to:

What is the interaction of the QOM device lifecycle (instance_init/realize/
unrealize/instance_finalize) with hotplug and hot-unplug ? I couldn't
find any documentation of this but maybe I was looking in the wrong

Looking at device_set_realized() it seems like we treat "realize"
as meaning "and also do the hot-plug if this is a device we're
trying to hotplug". On the other hand hot-unplug is I think the
other way around: when we get a hot-unplug event we assume that
it should also imply an "unrealize" (but just unrealizing doesn't
auto-hot-unplug) ?

Once a device is hot-unplugged (and thus unrealized) is it valid
for it to be re-hot-plugged, or is the assumption that it's then
destroyed and a fresh device is created if the user wants to plug
something in again later ? Put another way, is it valid for a qdev
device to see state transitions realize -> unrealize -> realize ?

-- PMM

reply via email to

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