Hi, when working on hot unplugs of various devices, I've found out that hot unplugging <lease> device doesn't generate VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event. <lease> also doesn't have an alias, so it wouldn't be identifiable in the corresponding callback. Is this difference from other hotpluggable devices intentional? If yes, is there any better way of checking that <lease> removal is completed than querying and examining the domain XML? From user's point of view, it would be best if I could simply handle the device removal event the same way as with other devices. Thanks, Milan
On Fri, Oct 12, 2018 at 19:33:54 +0200, Milan Zamazal wrote:> Hi, when working on hot unplugs of various devices, I've found out that > hot unplugging <lease> device doesn't generate > VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event. <lease> also doesn't have an > alias, so it wouldn't be identifiable in the corresponding callback. > > Is this difference from other hotpluggable devices intentional? If yes,Well a "lease" is not a device per-se. It's just libvirt putting it with devices. Currently the "lease" is always successfully removed/unplugged if the API returns success as there is no cooperation with qemu necessary so the semantics of asking the guest OS to do something don't apply.> is there any better way of checking that <lease> removal is completed > than querying and examining the domain XML? From user's point of view, > it would be best if I could simply handle the device removal event the > same way as with other devices.Yes, we probably should add the event and synthetize it for "lease" since we will not get one from qemu. Also we'll need to add alias for the lease so that the event can be used.
Milan Zamazal
2018-Oct-15 07:56 UTC
Re: [libvirt-users] Device lease hot unplug and events
Peter Krempa <pkrempa@redhat.com> writes:> On Fri, Oct 12, 2018 at 19:33:54 +0200, Milan Zamazal wrote: >> Hi, when working on hot unplugs of various devices, I've found out that >> hot unplugging <lease> device doesn't generate >> VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event. <lease> also doesn't have an >> alias, so it wouldn't be identifiable in the corresponding callback. >> >> Is this difference from other hotpluggable devices intentional? If yes, > > Well a "lease" is not a device per-se. It's just libvirt putting it with > devices. Currently the "lease" is always successfully removed/unplugged > if the API returns success as there is no cooperation with qemu > necessary so the semantics of asking the guest OS to do something don't > apply.I see, thank you for explanation. Can we rely on the fact that lease removal is and remains synchronous or is it a property that can change in the future?>> is there any better way of checking that <lease> removal is completed >> than querying and examining the domain XML? From user's point of view, >> it would be best if I could simply handle the device removal event the >> same way as with other devices. > > Yes, we probably should add the event and synthetize it for "lease" > since we will not get one from qemu. Also we'll need to add alias for > the lease so that the event can be used.Since this is what an uninformed user expects (and I believe libvirt documentation doesn't contradict), I'd like to have the event + alias. Should I file a corresponding bug or RFE? Thanks, Milan