Discussion:
[libvirt-users] Device lease hot unplug and events
Milan Zamazal
2018-10-12 17:33:54 UTC
Permalink
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
Peter Krempa
2018-10-15 06:36:53 UTC
Permalink
Post by Milan Zamazal
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.
Post by Milan Zamazal
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-10-15 07:56:39 UTC
Permalink
Post by Peter Krempa
Post by Milan Zamazal
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?
Post by Peter Krempa
Post by Milan Zamazal
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
Peter Krempa
2018-10-15 08:03:45 UTC
Permalink
Post by Milan Zamazal
Post by Peter Krempa
Post by Milan Zamazal
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?
In case of the current implementation I don't see a reason why we'd have
to change it. If so it would be for a different "model".

Generally we can't guarantee that some usage will not eventually need it
but we should not change this behaviour, or at least I don't expect us
to.
Post by Milan Zamazal
Post by Peter Krempa
Post by Milan Zamazal
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?
Yes please.
Milan Zamazal
2018-10-15 10:47:03 UTC
Permalink
Post by Peter Krempa
Post by Milan Zamazal
Post by Peter Krempa
Post by Milan Zamazal
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?
In case of the current implementation I don't see a reason why we'd have
to change it. If so it would be for a different "model".
Generally we can't guarantee that some usage will not eventually need it
but we should not change this behaviour, or at least I don't expect us
to.
Post by Milan Zamazal
Post by Peter Krempa
Post by Milan Zamazal
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?
Yes please.
OK, done: https://bugzilla.redhat.com/1639228

Continue reading on narkive:
Loading...