[PATCH 2/3] nodedev: immediate update of active config on udev add

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When an udev add event occurs the mdev active config data requires an
update via mdevctl as the udev does not contain all config data.
This update needs to occur immediate and to be finished before the
libvirt CREATE event is issued to keep the API usage reliable.

Signed-off-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx>
---
 src/node_device/node_device_udev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 4730a5b986..0f335df950 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1606,6 +1606,12 @@ udevAddOneDevice(struct udev_device *device)
     if (has_mdev_types)
         scheduleMdevctlUpdate(driver->privateData, false);
 
+    /* The added mdev needs an immediate active config update before
+     * the event is issues to allow sane API usage. */
+    if (is_mdev && (nodeDeviceUpdateMediatedDevices() < 0))
+        VIR_WARN("Update of mediated device %s failed",
+                 def ? NULLSTR(def->sysfs_path) : "");
+
     ret = 0;
 
  cleanup:
-- 
2.42.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux