[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: qom device lifecycle interaction with hotplug/hotunplug ?
From: |
Eduardo Habkost |
Subject: |
Re: qom device lifecycle interaction with hotplug/hotunplug ? |
Date: |
Fri, 29 Nov 2019 17:05:45 -0300 |
On Fri, Nov 29, 2019 at 12:45:09PM +0000, Peter Maydell wrote:
> On Fri, 29 Nov 2019 at 12:26, Igor Mammedov <address@hidden> wrote:
> > But from the my very limited understanding, on real hardware,
> > once device is uplugged it's gone (finalized) from machine
> > perspective, so it's unclear to my why someone would use
> > realize->unrealize->realize hotplug scenario.
>
> Well, on real hardware 'unplug' is different from 'unrealize'.
> So I think for QEMU if we wanted to allow this sort of 'unplug
> and replug the same device' we should do it by:
>
> instance_init -> realize -> plug -> unplug -> plug -> unplug ->
> unrealize -> finalize
>
> So unrealize/finalize is when the device is actually destroyed,
> and if you're going to replug the device you don't destroy it
> on unplug.
So, to summarize the current issues:
1) realize triggers a plug operation implicitly.
2) unplug triggers unrealize implicitly.
Do you expect to see use cases that will require us to implement
realize-without-plug?
Similarly, do you expect use cases that will require us to
implement unplug-without-unrealize?
--
Eduardo