On Tue, Aug 18, 2020 at 09:47:57AM -0500, Jonathon Jongsma wrote: > At startup, query devices that are defined by 'mdevctl' and add them to > the node device list. > > This adds a complication: we now have two potential sources of > information for a node device: > - udev for all devices and for activated mediated devices > - mdevctl for persistent mediated devices > > Unfortunately, neither backend returns full information for a mediated > device. For example, if a persistent mediated device in the list (with > information provided from mdevctl) is 'started', that same device will > now be detected by udev. If we simply overwrite the existing device > definition with the new one provided by the udev backend, we will lose > extra information that was provided by mdevctl (e.g. attributes, etc). > To avoid this, make sure to copy the extra information into the new > device definition. > > Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx> > --- ... > > static int > udevAddOneDevice(struct udev_device *device) > @@ -1341,6 +1380,8 @@ udevAddOneDevice(struct udev_device *device) > goto cleanup; > > if ((obj = virNodeDeviceObjListFindByName(driver->devs, def->name))) { > + nodeDeviceDefCopyExtraData(def, virNodeDeviceObjGetDef(obj)); I'm a tiny bit lost here, what scenario does ^this address? Erik