[PATCH] nodedev_udev: Fix missing events when kernel report lots of udev events within a short time

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

 



From: "ning.bo" <ning.bo9@xxxxxxxxxx>

When create Virtual Function for Inter XL710 use below commands:
for i in `seq 0 1`; do
        echo 63 > /sys/devices/pci0000:00/0000:00:03.2/0000:07:00.$i/sriov_numvfs
done
for i in `seq 0 3`; do
        echo 31 > /sys/devices/pci0000:80/0000:80:02.2/0000:82:00.$i/sriov_numvfs
done

The libvirtd will missing some udev events, the result of libvirt-python API
listDevices('pci') will not list all pci devices.
The reason is that the buffer of udev monitor default size cann't save all udev
events reported by kernel.
So we need change buffer size so that we can receive as much events as possible
whitin a short time.

Signed-off-by: ning.bo <ning.bo9@xxxxxxxxxx>
---
 src/node_device/node_device_udev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 6e706a1..d813206 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1564,6 +1564,7 @@ static int nodeStateInitialize(bool privileged,
     }
 
     udev_monitor_enable_receiving(priv->udev_monitor);
+    udev_monitor_set_receive_buffer_size(priv->udev_monitor, 128 * 1024 * 1024);
 
     /* We register the monitor with the event callback so we are
      * notified by udev of device changes before we enumerate existing
-- 
2.8.3


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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