]> xenbits.xensource.com Git - libvirt.git/commitdiff
nodedev: fix mdev add udev event data handling
authorBoris Fiuczynski <fiuczy@linux.ibm.com>
Tue, 23 Apr 2024 18:08:47 +0000 (20:08 +0200)
committerJonathon Jongsma <jjongsma@redhat.com>
Tue, 18 Jun 2024 13:58:10 +0000 (08:58 -0500)
Two situations will trigger an udev add event:
 1) the mdev is created when started (transient) or
 2) the mdev was defined and is started
In case 1 there is no node object existing and no config data is copied.
In case 2 copying the active config data of an existing node object will
only copy invalid data. Instead copying the defined config data will
store valid data into the newly added node object.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
src/node_device/node_device_udev.c

index 237cd7f64556baf782059def83d6e645f84460c4..85a8d4e206a863bcc9eca648e5fc189c3395c9de 100644 (file)
@@ -1572,7 +1572,7 @@ udevAddOneDevice(struct udev_device *device)
         objdef = virNodeDeviceObjGetDef(obj);
 
         if (is_mdev)
-            nodeDeviceDefCopyFromMdevctl(def, objdef, false);
+            nodeDeviceDefCopyFromMdevctl(def, objdef, true);
 
         persistent = virNodeDeviceObjIsPersistent(obj);
         autostart = virNodeDeviceObjIsAutostart(obj);