On Tue, Apr 23, 2019 at 03:06:22PM +0200, Michal Privoznik wrote: > On 4/16/19 1:39 AM, Cole Robinson wrote: > > 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' > > Yeah, it's annoying, but I remember discussion from when I was introducing > user aliases. I wanted to just have some dummy element that would not mean > anything to libvirt but users could set it and then match devices using it > as a mark. It was rejected because it doesn't map onto anything in qemu. > Well, nor do leases, nor would their address. > > I don't have a preference here really. But if we wanted to invent addresees > for leases then I guess we would have to do it for already running domains > too (when daemon restarts). My preference is for the new event as this series does. We shouldn't try to force something to be more like a device when it clearly isn't. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :| -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list