1. 10 9月, 2019 2 次提交
  2. 12 4月, 2019 1 次提交
  3. 10 4月, 2019 2 次提交
  4. 04 2月, 2019 1 次提交
  5. 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
  6. 05 12月, 2018 1 次提交
  7. 24 9月, 2018 1 次提交
  8. 20 9月, 2018 2 次提交
  9. 17 9月, 2018 2 次提交
  10. 12 9月, 2018 1 次提交
  11. 07 8月, 2018 2 次提交
  12. 12 8月, 2017 1 次提交
    • L
      util: restructure virNetDevReadNetConfig() to eliminate false error logs · 9a081683
      Laine Stump 提交于
      virHostdevRestoreNetConfig() calls virNetDevReadNetConfig() to try and
      read the "original config" of a netdev, and if that fails, it tries
      again with a different directory/netdev name. This achieves the
      desired effect (we end up finding the config wherever it may be), but
      for each failure, virNetDevReadNetConfig() places a nice error message
      in the system logs. Experience has shown that false-positive error
      logs like this lead to erroneous bug reports, and can often mislead
      those searching for *real* bugs.
      
      This patch changes virNetDevReadNetConfig() to explicitly check if the
      file exists before calling virFileReadAll(); if it doesn't exist,
      virNetDevReadNetConfig() returns a success, but leaves all the
      variables holding the results as NULL. (This makes sense if you define
      the purpose of the function as "read a netdev's config from its config
      file *if that file exists*).
      
      To take advantage of that change, the caller,
      virHostdevRestoreNetConfig() is modified to fail immediately if
      virNetDevReadNetConfig() returns an error, and otherwise to try the
      different directory/netdev name if adminMAC & vlan & MAC are all NULL
      after the preceding attempt.
      9a081683
  13. 28 4月, 2017 1 次提交
  14. 27 3月, 2017 1 次提交
    • L
      util: use new virNetDev*NetConfig() functions for macvtap setup/teardown · b91a3363
      Laine Stump 提交于
      This patch modifies the macvtap passthrough setup to use
      virNetDevSaveNetConfig()+virNetDevSetConfig() instead of
      virNetDevReplaceNetConfig() or virNetDevReplaceMacAddress(), and the
      teardown to use virNetDevReadNetConfig()+virNetDevSetConfig() instead
      of virNetDevRestoreNetConfig() or virNetDevRestoreMacAddress().
      
      Since the older functions only saved/restored the admin MAC and vlan
      tag (which is incorrect) and the new functions save/restore the VF's
      own MAC address and vlan tag (correct), this actually fixes a bug
      (which was introduced by commit cb3fe38c, which was itself supposed
      to be a fix for https://bugzilla.redhat.com/1113474 ).
      
      The downside to this patch is that it causes an *apparent* regression
      in that bug (because there will once again be an error reported if the
      interface had previously been used for VFIO device assignment), but in
      reality, the code hasn't been working for *any* case before this
      current patch (at least not with any recent kernel). Anyway, that
      "regression" will be fixed with an upcoming patch that fixes it the
      *right* way.
      b91a3363
  15. 24 3月, 2017 1 次提交
    • L
      util: eliminate useless local variable · 606a0133
      Laine Stump 提交于
      vf in virNetDevMacVLanDeleteWithVPortProfile() is initialized to -1
      and never set. It's not set for a good reason - because it doesn't
      make sense during macvtap device setup to refer to a VF device as
      "PF:VF#". This patch replaces the two uses of "vf" with "-1", and
      removes the local variable, so that it's more clear we are always
      calling the utility functions with vf set to -1.
      606a0133
  16. 11 2月, 2017 1 次提交
  17. 10 8月, 2016 3 次提交
  18. 11 5月, 2016 1 次提交
    • L
      util: set vlan tag for macvtap passthrough mode on SRIOV VFs · 75db9997
      Laine Stump 提交于
      SRIOV VFs used in macvtap passthrough mode can take advantage of the
      SRIOV card's transparent vlan tagging. All the code was there to set
      the vlan tag, and it has been used for SRIOV VFs used for hostdev
      interfaces for several years, but for some reason, the vlan tag for
      macvtap passthrough devices was stubbed out with a -1.
      
      This patch moves a bit of common validation down to a lower level
      (virNetDevReplaceNetConfig()) so it is shared by hostdev and macvtap
      modes, and updates the macvtap caller to actually send the vlan config
      instead of -1.
      75db9997
  19. 29 3月, 2016 1 次提交
    • L
      util: avoid getting stuck on macvtapN name created outside libvirt · 5b5f12cf
      Laine Stump 提交于
      After the patches that added tracking of in-use macvtap names (commit
      370608, first appearing in libvirt-1.3.2), if the function to allocate
      a new macvtap device came to a device name created outside libvirt, it
      would retry the same device name MACVLAN_MAX_ID (8191) times before
      finally giving up in failure.
      
      The problem was that virBitmapNextClearBit was always being called
      with "0" rather than the value most recently checked (which would
      increment each time through the loop), so it would always return the
      same id (since we dutifully release that id after failing to create a
      new device using it).
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1321546Signed-off-by: NLaine Stump <laine@laine.org>
      5b5f12cf
  20. 27 1月, 2016 2 次提交
    • M
      virnetdevmacvlan: Provide stubs for build without macvtap · 720bc953
      Michal Privoznik 提交于
      In 370608b4 we have introduced two new internal APIs.
      However, there are no stubs for build without macvtap. Therefore
      build on systems lacking macvtap support (e.g. mingw or freebds)
      fails when trying to link.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      720bc953
    • L
      util: keep/use a bitmap of in-use macvtap devices · 370608b4
      Laine Stump 提交于
      This patch creates two bitmaps, one for macvlan device names and one
      for macvtap. The bitmap position is used to indicate that libvirt is
      currently using a device with the name macvtap%d/macvlan%d, where %d
      is the position in the bitmap. When requested to create a new
      macvtap/macvlan device, libvirt will now look for the first clear bit
      in the appropriate bitmap and derive the device name from that rather
      than just starting at 0 and counting up until one works.
      
      When libvirtd is restarted, the qemu driver code that reattaches to
      active domains calls the appropriate function to "re-reserve" the
      device names as it is scanning the status of running domains.
      
      Note that it may seem strange that the retry counter now starts at
      8191 instead of 5. This is because we now don't do a "pre-check" for
      the existence of a device once we've reserved it in the bitmap - we
      move straight to creating it; although very unlikely, it's possible
      that someone has a running system where they have a large number of
      network devices *created outside libvirt* named "macvtap%d" or
      "macvlan%d" - such a setup would still allow creating more devices
      with the old code, while a low retry max in the new code would cause a
      failure. Since the objective of the retry max is just to prevent an
      infinite loop, and it's highly unlikely to do more than 1 iteration
      anyway, having a high max is a reasonable concession in order to
      prevent lots of new failures.
      370608b4
  21. 23 1月, 2016 1 次提交
    • L
      util: reset MAC address of macvtap passthrough physdev after disassociate · 29cc45cb
      Laine Stump 提交于
      libvirt always resets the MAC address of the physdev used for macvtap
      passthrough when the guest is finished with it. This was happening
      prior to the 802.1Qb[gh] DISASSOCIATE command, and was quite often
      failing, presumably because the driver wouldn't allow the MAC address
      to be reset while the association was still active, with a log message
      like this:
      
      virNetDevSetMAC:168 : Cannot set interface MAC to 00:00:00:00:00:00 on 'eth13': Cannot assign requested address
      
      This patch changes the order - we now do the 802.1Qb[gh] disassociate
      and delete the macvtap interface first, then and reset the MAC
      address.
      29cc45cb
  22. 14 12月, 2015 1 次提交
    • M
      virNetDevMacVLanTapSetup: Drop @multiqueue argument · 65e3451e
      Michal Privoznik 提交于
      Firstly, there's a bug (or typo) in the only place where we call
      this function: @multiqueue is set whenever @tapfdSize is greater
      than zero, while in fact the condition should have been 'greater
      than one'.
      Then, secondly, since the condition depends on just one
      variable, that we are even passing down to the function, we can
      move the condition into the function and drop useless argument.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      65e3451e
  23. 13 12月, 2015 1 次提交
    • M
      virNetDevMacVLanTapSetup: Work around older systems · ec93cc25
      Michal Privoznik 提交于
      Some older systems, e.g. RHEL-6 do not have IFF_MULTI_QUEUE flag
      which we use to enable multiqueue feature. Therefore one gets the
      following compile error there:
      
        CC     util/libvirt_util_la-virnetdevmacvlan.lo
      util/virnetdevmacvlan.c: In function 'virNetDevMacVLanTapSetup':
      util/virnetdevmacvlan.c:338: error: 'IFF_MULTI_QUEUE' undeclared (first use in this function)
      util/virnetdevmacvlan.c:338: error: (Each undeclared identifier is reported only once
      util/virnetdevmacvlan.c:338: error: for each function it appears in.)
      make[3]: *** [util/libvirt_util_la-virnetdevmacvlan.lo] Error 1
      
      So, whenever user wants us to enable the feature on such systems,
      we will just throw a runtime error instead.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ec93cc25
  24. 11 12月, 2015 6 次提交
  25. 04 11月, 2015 1 次提交
  26. 03 9月, 2015 1 次提交
    • L
      util: don't use netlink to save/set mac for macvtap+passthrough+802.1Qbh · 46cf0cef
      Laine Stump 提交于
      Before libvirt sets the MAC address of the physdev (the physical
      ethernet device) linked to a macvtap passthrough device, it always
      saves the previous MAC address to restore when the guest is finished
      (following a "leave nothing behind" policy). For a long time it
      accomplished the save/restore with a combination of
      ioctl(SIOCGIFHWADDR) and ioctl(SIOCSIFHWADDR), but in commit cbfe38c
      (first in libvirt 1.2.15) this was changed to use netlink RTM_GETLINK
      and RTM_SETLINK commands sent to the Physical Function (PF) of any
      device that was detected to be a Virtual Function (VF).
      
      We later found out that this caused problems with any devices using
      the Cisco enic driver (e.g. vmfex cards) because the enic driver
      hasn't implemented the function that is called to gather the
      information in the IFLA_VFINFO_LIST attribute of RTM_GETLINK
      (ndo_get_vf_config() for those keeping score), so we would never get
      back a useful response.
      
      In an ideal world, all drivers would implement all functions, but it
      turns out that in this case we can work around this omission without
      any bad side effects - since all macvtap passthrough <interface>
      definitions pointing to a physdev that uses the enic driver *must*
      have a <virtualport type='802.1Qbh'>, and since no other type of
      ethernet devices use 802.1Qbh, libvirt can change its behavior in this
      case to use the old-style.  ioctl(SIOC[GS]IFHWADDR).  That's what this
      patch does.
      
      Resolves:  https://bugzilla.redhat.com/show_bug.cgi?id=1257004
      46cf0cef
  27. 29 8月, 2015 1 次提交
    • L
      util: fallback to ioctl(SIOCBRDELBR) if netlink RTM_DELLINK fails · 97d26e47
      Laine Stump 提交于
      commit 09778e09 switched from using ioctl(SIOCBRDELBR) for bridge
      device deletion to using a netlink RTM_DELLINK message, which is the
      more modern way to delete a bridge (and also doesn't require the
      bridge to be ~IFF_UP to succeed). However, although older kernels
      (e.g. 2.6.32, in RHEL6/CentOS6) support deleting *some* link types
      with RTM_NEWLINK, they don't support deleting bridges, and there is no
      compile-time way to figure this out.
      
      This patch moves the body of the SIOCBRDELBR version of
      virNetDevBridgeDelete() into a static function, calls the new function
      from the original, and also calls the new function from the
      RTM_DELLINK version if the RTM_DELLINK message generates an EOPNOTSUPP
      error. Since RTM_DELLINK is done from the subordinate function
      virNetlinkDelLink, which is also called for other purposes (deleting a
      macvtap interface), a function pointer called "fallback" has been
      added to the arglist of virNetlinkDelLink() - if that arg != NULL, the
      provided function will be called when (and only when) RTM_DELLINK
      fails with EOPNOTSUPP.
      
      Resolves:  https://bugzilla.redhat.com/show_bug.cgi?id=1252780 (part 2)
      97d26e47