1. 23 4月, 2020 13 次提交
  2. 22 4月, 2020 13 次提交
  3. 21 4月, 2020 11 次提交
  4. 20 4月, 2020 3 次提交
    • M
      Avoid unnecessary error messages handling udev events · 72d99b09
      Mark Asselstine 提交于
      The udev monitor thread "udevEventHandleThread()" will lag the
      actual/real view of devices in sysfs as it serially processes udev
      monitor events. So for instance if you were to run the following cmd
      to create a new veth pair and rename one of the veth endpoints
      
      you might see the following monitor events and real world that looks like
      
                                           time
      			              |    create v0 sysfs entry
      wake udevEventHandleThread            |    create v1 sysfs entry
      udev_monitor_receive_device(v1-add)   |    move v0 sysfs to v2
      udevHandleOneDevice(v1)               |
      udev_monitor_receive_device(v0-add)   |
      udevHandleOneDevice(v0)               | <--- error msgs in virNetDevGetLinkInfo()
      udev_monitor_receive_device(v2-move)  |      as v0 no longer exists
      udevHandleOneDevice(v2)               |
                                           \/
      
      As you can see the changes in sysfs can take place well before we get
      to act on the events in the udevEventHandleThread(), so by the time we
      get around to processing the v0 add event, the sysfs entry has been
      moved to v2.
      
      To work around this we check if the sysfs entry is valid before
      attempting to read it and don't bother trying to read link info if
      not. This is safe since we will never read sysfs entries earlier than
      it existing, ie. if the entry is not there it has either been removed
      in the time since we enumerated the device or something bigger is
      busted, in either case, no sysfs entry, no link info. In the case
      described above we will eventually get the link info as we work
      through the queue of monitor events and get to the 'move' event.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1557902Signed-off-by: NMark Asselstine <mark.asselstine@windriver.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      72d99b09
    • M
      node_device_udev: handle move events · abbd3a31
      Mark Asselstine 提交于
      It is possible and common to rename some devices, this is especially
      true for ethernet devices such as veth pairs.
      
      In the udevEventHandleThread() we will be notified of this change but
      currently we only process "add", "change" and "remove"
      events. Renaming a device such as above results in a "move" event, not
      a "remove" followed by and "add" or vise versa. This change will add
      the new/destination device to our records but unfortunately there is
      no usable mechanism to identify the old/source device to remove it
      from the records. So this is admittedly only a partial fix.
      Signed-off-by: NMark Asselstine <mark.asselstine@windriver.com>
      Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      abbd3a31
    • P
      doc/python: Update to Python 3 · a7f0a3a2
      Philipp Hahn 提交于
      Convert the simple example to Python 3 syntax:
      - print() is a function
      - do not use bare except
      - libvirt.open*() does not return None but raises an exception
      
      The referenced source for the example was removed with
      5bb2a245Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      a7f0a3a2