libvirt/src/node_device
Michal Privoznik 9a13704818 udevHandleOneDevice: Remove old instance of device on "move"
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: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2020-04-22 12:51:15 +02:00
..
Makefile.inc.am systemd: Add sysconf files for all daemons 2020-04-03 11:50:47 +02:00
node_device_driver.c nodedev: fix race in API usage vs initial device enumeration 2020-03-16 17:35:04 +00:00
node_device_driver.h node_device_driver.h: Use #pragma once 2019-04-04 18:42:09 -04:00
node_device_hal.c nodedev: fix race in API usage vs initial device enumeration 2020-03-16 17:35:04 +00:00
node_device_hal.h node_device_hal.h: Use #pragma once 2019-04-04 18:42:10 -04:00
node_device_udev.c udevHandleOneDevice: Remove old instance of device on "move" 2020-04-22 12:51:15 +02:00
node_device_udev.h node_device_udev.h: Use #pragma once 2019-04-04 18:42:09 -04:00
virtnodedevd.init.in configure: Provide OpenRC scripts for sub-daemons 2019-12-16 10:11:22 +01:00
virtnodedevd.service.in systemd: Move timeout from service files to sysconf files 2020-04-03 11:50:50 +02:00
virtnodedevd.sysconf systemd: Move timeout from service files to sysconf files 2020-04-03 11:50:50 +02:00