1. 24 4月, 2020 17 次提交
  2. 23 4月, 2020 21 次提交
  3. 22 4月, 2020 2 次提交
    • M
      udevHandleOneDevice: Remove old instance of device on "move" · 9a137048
      Michal Privoznik 提交于
      When a device is "move"-d (this basically means it was renamed),
      we add the new device onto our list but keep the old there too.
      Fortunately, udev sets this DEVPATH_OLD property which points to
      the old device path. We can use it to remove the old instance.
      
      To test this try renaming an interface, for instance:
      
        # ip link set tunl0 name tunl1
        # ip link set tunl1 name tunl0
      
      One problem with udev is that it sends old ifname in INTERFACE
      property, which creates a problem for us, the property is where
      we get the ifname from and use it then to query all kind of info
      about the interface. Well, if it is non-existent then we can't
      query anything. This happens if ifname rename is suppressed
      (net.ifnames=0 on kernel cmd line for instance). Fortunately, we
      can use "kernel" source for udev events which has always the
      fresh info.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
      9a137048
    • M
      node_device_udev: Split udevRemoveOneDevice() into two · bfa8cf4b
      Michal Privoznik 提交于
      Move internals of udevRemoveOneDevice() into a separate function
      which accepts sysfs path as an argument and actually removes the
      device from the internal list. It will be reused later.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
      bfa8cf4b