1. 26 6月, 2020 1 次提交
  2. 19 6月, 2020 1 次提交
  3. 22 4月, 2020 3 次提交
  4. 20 4月, 2020 1 次提交
    • 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
  5. 17 3月, 2020 1 次提交
    • D
      nodedev: fix race in API usage vs initial device enumeration · 008abeb0
      Daniel P. Berrangé 提交于
      During startup the udev node device driver impl uses a background thread
      to populate the list of devices to avoid blocking the daemon startup
      entirely. There is no synchronization to the public APIs, so it is
      possible for an application to start calling APIs before the device
      initialization is complete.
      
      This was not a problem in the old approach where libvirtd was started
      on boot, as initialization would easily complete before any APIs were
      called.
      
      With the use of socket activation, however, APIs are invoked from the
      very moment the daemon starts. This is easily seen by doing a
      
        'virsh -c nodedev:///system list'
      
      the first time it runs it will only show one or two devices. The second
      time it runs it will show all devices. The solution is to introduce a
      flag and condition variable for APIs to synchronize against before
      returning any data.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      008abeb0
  6. 05 3月, 2020 1 次提交
  7. 25 2月, 2020 1 次提交
  8. 27 1月, 2020 1 次提交
    • D
      libvirt: pass a directory path into drivers for embedded usage · 207709a0
      Daniel P. Berrangé 提交于
      The intent here is to allow the virt drivers to be run directly embedded
      in an arbitrary process without interfering with libvirtd. To achieve
      this they need to store all their configuration & state in a separate
      directory tree from the main system or session libvirtd instances.
      
      This can be useful for doing testing of the virt drivers in "make check"
      without interfering with the user's own libvirtd instances.
      
      It can also be used for applications using KVM/QEMU as a piece of
      infrastructure to build an service, rather than for general purpose
      OS hosting. A long standing example is libguestfs, which would prefer
      if its temporary VMs did show up in the main libvirtd VM list, because
      this confuses apps such as OpenStack Nova. A more recent example would
      be Kata which is using KVM as a technology to build containers.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NCole Robinson <crobinso@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      207709a0
  9. 03 1月, 2020 1 次提交
  10. 20 12月, 2019 1 次提交
  11. 10 12月, 2019 1 次提交
  12. 13 11月, 2019 1 次提交
  13. 12 11月, 2019 1 次提交
  14. 25 10月, 2019 1 次提交
  15. 21 10月, 2019 3 次提交
  16. 16 10月, 2019 1 次提交
  17. 15 10月, 2019 2 次提交
  18. 27 8月, 2019 1 次提交
  19. 09 8月, 2019 1 次提交
  20. 15 7月, 2019 1 次提交
  21. 11 7月, 2019 1 次提交
    • D
      nodedev: acquire a pidfile in the driver root directory · 3e846a16
      Daniel P. Berrangé 提交于
      When we allow multiple instances of the driver for the same user
      account, using a separate root directory, we need to ensure mutual
      exclusion. Use a pidfile to guarantee this.
      
      In privileged libvirtd this ends up locking
      
         /var/run/libvirt/nodedev/driver.pid
      
      In unprivileged libvirtd this ends up locking
      
        /run/user/$UID/libvirt/nodedev/run/driver.pid
      
      NB, the latter can vary depending on $XDG_RUNTIME_DIR
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      3e846a16
  22. 16 5月, 2019 1 次提交
  23. 15 5月, 2019 1 次提交
  24. 22 3月, 2019 1 次提交
  25. 18 3月, 2019 1 次提交
  26. 21 2月, 2019 2 次提交
  27. 14 2月, 2019 1 次提交
  28. 04 2月, 2019 1 次提交
  29. 14 12月, 2018 1 次提交
    • D
      Remove all Author(s): lines from source file headers · 60046283
      Daniel P. Berrangé 提交于
      In many files there are header comments that contain an Author:
      statement, supposedly reflecting who originally wrote the code.
      In a large collaborative project like libvirt, any non-trivial
      file will have been modified by a large number of different
      contributors. IOW, the Author: comments are quickly out of date,
      omitting people who have made significant contribitions.
      
      In some places Author: lines have been added despite the person
      merely being responsible for creating the file by moving existing
      code out of another file. IOW, the Author: lines give an incorrect
      record of authorship.
      
      With this all in mind, the comments are useless as a means to identify
      who to talk to about code in a particular file. Contributors will always
      be better off using 'git log' and 'git blame' if they need to  find the
      author of a particular bit of code.
      
      This commit thus deletes all Author: comments from the source and adds
      a rule to prevent them reappearing.
      
      The Copyright headers are similarly misleading and inaccurate, however,
      we cannot delete these as they have legal meaning, despite being largely
      inaccurate. In addition only the copyright holder is permitted to change
      their respective copyright statement.
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      60046283
  30. 05 11月, 2018 1 次提交
    • J
      nodedev: Document the udevEventHandleThread · 29183778
      John Ferlan 提交于
      Commit cdbe1332 neglected to document the API. So let's add some
      details about the algorithm and why it was used to help future
      readers understand the issues encountered.
      
      NB: Management of the processing udev device notification is a
      delicate balance between the udev process, the scheduler, and when
      exactly the data from/for the socket is received. The balance is
      particularly important for environments when multiple devices are
      added into the system more or less simultaneously such as is done
      for mdev or SRIOV. In these cases old libudev blocking on the udev
      recv() occurs more frequently. It's expected that future devices
      will follow similar algorithms. Even though the algorithm does
      present some challenges for older OS's (such as Centos 6), trying
      to rewrite the algorithm to fit both models would be more complex
      and involve pulling the monitor object out of the private data
      lockable object and would need to be guarded by a separate lock.
      Devising such an algorithm to work around issues with older OS's
      at the expense of more modern OS algorithms in newer event processing
      code may result in unexpected issues, so the choice is to encourage
      use of newer OS's with newer udev event processing code.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      29183778
  31. 12 6月, 2018 1 次提交
  32. 18 4月, 2018 1 次提交
    • M
      virobject: Introduce VIR_CLASS_NEW() macro · 10f94828
      Michal Privoznik 提交于
      So far we are repeating the following lines over and over:
      
        if (!(virSomeObjectClass = virClassNew(virClassForObject(),
                                   "virSomeObject",
                                   sizeof(virSomeObject),
                                   virSomeObjectDispose)))
            return -1;
      
      While this works, it is impossible to do some checking. Firstly,
      the class name (the 2nd argument) doesn't match the name in the
      code in all cases (the 3rd argument). Secondly, the current style
      is needlessly verbose. This commit turns example into following:
      
        if (!(VIR_CLASS_NEW(virSomeObject,
                            virClassForObject)))
            return -1;
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      10f94828
  33. 12 4月, 2018 2 次提交