[libvirt] [PATCH 0/3] Emit event on lease attach/detach

Cole Robinson crobinso at redhat.com
Mon Apr 15 23:39:32 UTC 2019


On 4/5/19 3:57 AM, Michal Privoznik wrote:
> Unfortunately, we can't emit VIR_DOMAIN_EVENT_ID_DEVICE_ADDED or
> VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event because that carries device
> alias within itself and leases don't have one.
> 

Hmm. I understand that <leases> aren't really devices so it doesn't have
any direct reason to give it an info structure and assign it an alias.
But that's really an argument for why they shouldn't have been  a device
to begin with. I presume we did it that way to take advantage of the
existing hotplug APIs. But then adding a special purpose event seems
like going in the opposite direction.

How invasive is it to add an 'info' bit to lease devices, allocate
aliases with the rest of qemu devices, maybe add an ADDRESS_TYPE_LEASE
or something that is just an explicit no op for the ADDRESS consumers.
My guess is it's not too bad but there could be dragons lurking

There's already places internally where this would simplify things: it's
annoying that device iterator code already needs to play games like
'check the address of all devices, oh except leases and graphics which
don't have info, oh and hostdev info is a pointer for some reason'

- Cole




More information about the libvir-list mailing list