qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laine Stump <laine@redhat.com>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	libvir-list@redhat.com, Michal Privoznik <mprivozn@redhat.com>
Subject: Re: [Qemu-devel] [libvirt] qapi DEVICE_DELETED event issued *before* instance_finalize?!
Date: Tue, 6 Sep 2016 10:02:22 -0400	[thread overview]
Message-ID: <dddc90d3-785d-49c2-5624-741afa6843f3@redhat.com> (raw)
In-Reply-To: <20160905201851.68fac3c3@t450s.home>

On 09/05/2016 10:18 PM, Alex Williamson wrote:
> On Mon, 5 Sep 2016 11:36:55 +0200
> Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>> On 05/09/2016 11:23, Markus Armbruster wrote:
>>>>> On the other hand, it is clearly documented that the DEVICE_DELETED
>>>>> event is sent as soon as guest acknowledges completion of device
>>>>> removal. So libvirt's buggy if we'd follow documentation strictly. But
>>>>> then again, I don't see much information value in "guest has detached
>>>>> device but qemu hasn't yet" event. Libvirt would ignore such event.
>>> Unless I'm missing something, libvirt needs an event that signals "Guest
>>> and QEMU are done with this device".  Current DEVICE_DELETED isn't.
>>>
>>> Can we imagine a use for current DEVICE_DELETED, i.e. "Guest is done,
>>> but QEMU isn't"?
>>>
>>> Would anything break if we changed semantics of DEVICE_DELETED to what
>>> libvirt actually needs?
>>>
>>> If the answers are "no" and "no", let's do it.
>> There is a subtle aspect of this.  After the current DEVICE_DELETED, the
>> device id is not used any more.  So technically you could have
>>
>>     device_add bar,id=foo
>>     device_del foo
>>
>>     // something in QEMU prevents the device from going away?
>>     // for example there is a storage issue that blocks completion
>>     // of a read(), and bar is a storage device
>>
>>     device_add bar,id=foo
>>     device_del foo
>>
>>     // which foo is being deleted?  The old one or the new one?
>>     event DEVICE_DELETED
>>
>> DEVICE_DELETED does have a meaning: management cannot talk to the device
>> anymore in QMP once it is raised.
> It seems like this is just pointing out another flaw in the semantics
> of DEVICE_DELETED, a device can linger without a device id, so there's
> no way to reference it via QMP.

Ah, right. I hadn't caught that. Yeah, since it's the device id that's 
used to keep track of which device the event is for, then it seems 
impossible to have an event that's issued after the device id is already 
recycled.

>   QEMU can't signal anything more about
> the device, nor can the VM admin perform any further operations on it.
> It's like detecting planets around distant stars, libvirt can't actually
> see the device, it can only monitor the affects the device has on the
> VM.  This is broken and it seems like the fix is to push both the
> release of the device id and the DEVICE_DELETED notification until
> after the instance_finalize callback.  Doesn't that solve the nuance
> you've identified here as well?

This works perfectly for libvirt.

  reply	other threads:[~2016-09-06 14:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01 23:11 [Qemu-devel] qapi DEVICE_DELETED event issued *before* instance_finalize?! Alex Williamson
2016-09-02  4:31 ` [Qemu-devel] [libvirt] " Michal Privoznik
2016-09-05  9:23   ` Markus Armbruster
2016-09-05  9:36     ` Paolo Bonzini
2016-09-06  1:05       ` Laine Stump
2016-09-06  2:18       ` Alex Williamson
2016-09-06 14:02         ` Laine Stump [this message]
2016-09-06 14:26           ` Paolo Bonzini
2016-09-06 14:25         ` Paolo Bonzini

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=dddc90d3-785d-49c2-5624-741afa6843f3@redhat.com \
    --to=laine@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=mprivozn@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).