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

[libvirt] [PATCH] udev: should not list bridge devices



When using udev backend, virsh iface-list outputs bridge devices
like:
 Name                 State      MAC Address
 --------------------------------------------
 em1                  active     e8:39:35:58:d5:94
 lo                   active     00:00:00:00:00:00
 virbr0               active     fe:54:00:a5:f6:42

The patch filters out bridge devices.

---
 src/interface/interface_backend_udev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
index 1fd7d46..92648e8 100644
--- a/src/interface/interface_backend_udev.c
+++ b/src/interface/interface_backend_udev.c
@@ -78,6 +78,9 @@ udevGetDevices(struct udev *udev, virUdevStatus status)
     /* Ignore devices that are part of a bridge */
     udev_enumerate_add_nomatch_sysattr(enumerate, "brport/state", NULL);
 
+    /* Ignore bridge devices */
+    udev_enumerate_add_nomatch_sysattr(enumerate, "bridge/bridge_id", NULL);
+
     /* State of the device */
     switch (status) {
         case VIR_UDEV_IFACE_ACTIVE:
-- 
1.8.1.4


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