From: Igor Mammedov <imammedo@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Damien Hedde <damien.hedde@greensocs.com>,
Paolo Bonzini <pbonzini@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: qom device lifecycle interaction with hotplug/hotunplug ?
Date: Fri, 29 Nov 2019 13:26:41 +0100 [thread overview]
Message-ID: <20191129132641.4c7da6c5@redhat.com> (raw)
In-Reply-To: <CAFEAcA-qA6n49KdHsGLqt422L_b_9xPfSaJB3tATQvRdfKt-xw@mail.gmail.com>
On Thu, 28 Nov 2019 17:57:56 +0000
Peter Maydell <peter.maydell@linaro.org> wrote:
> On Thu, 28 Nov 2019 at 17:27, Igor Mammedov <imammedo@redhat.com> wrote:
> >
> > On Thu, 28 Nov 2019 16:00:06 +0000
> > Peter Maydell <peter.maydell@linaro.org> wrote:
> > > 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 ?
> >
> > I don't think we do it currently (or maybe we do with failover but
> > I missed that train), but I don't see why it can't be done.
>
> Well, as Eduardo says, if we don't currently do it then
> we probably have a lot of subtly buggy code. Requiring it to work
> imposes a requirement on the 'unrealize' function that it
> doesn't just do required cleanup/resource releasing actions,
> but also returns the device back to exactly the state it was in
> after instance_init, so that 'realize' will work correctly.
> That's quite a lot of code auditing/effort if we don't actually
> have a current or future use for making this work, rather than
> just requiring that an unrealized device object is immediately
> finalized without possibility of resurrection.
>
> If we do have a plausible usecase then I think we should document
> that unrealize needs to handle this, and also have a basic
> smoke test of the realize->unrealize->realize.
yep, if we talk about generic approach, it's a problem.
But if a concrete combo of device/hotplug controller is considered
where such flow were necessary, it should be possible.
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.
>
> thanks
> -- PMM
>
next prev parent reply other threads:[~2019-11-29 12:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-28 16:00 qom device lifecycle interaction with hotplug/hotunplug ? Peter Maydell
2019-11-28 16:33 ` Eduardo Habkost
2019-11-29 12:40 ` Igor Mammedov
2019-11-29 19:53 ` Eduardo Habkost
2019-11-28 17:27 ` Igor Mammedov
2019-11-28 17:57 ` Peter Maydell
2019-11-29 12:26 ` Igor Mammedov [this message]
2019-11-29 12:45 ` Peter Maydell
2019-11-29 13:05 ` Damien Hedde
2019-11-29 14:23 ` Igor Mammedov
2019-11-29 20:05 ` Eduardo Habkost
2019-11-30 11:10 ` Peter Maydell
2019-12-03 21:40 ` Eduardo Habkost
2019-12-04 9:18 ` Jens Freimann
2019-12-04 14:35 ` Eduardo Habkost
2019-12-04 16:21 ` Jens Freimann
2019-12-04 18:51 ` Eduardo Habkost
2019-12-11 12:52 ` Damien Hedde
2019-12-18 15:14 ` Jens Freimann
2019-12-11 16:01 ` Igor Mammedov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191129132641.4c7da6c5@redhat.com \
--to=imammedo@redhat.com \
--cc=damien.hedde@greensocs.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).