1. 17 12月, 2019 1 次提交
  2. 16 10月, 2019 2 次提交
  3. 15 10月, 2019 1 次提交
  4. 14 10月, 2019 1 次提交
  5. 23 8月, 2019 2 次提交
  6. 06 8月, 2019 4 次提交
  7. 19 6月, 2019 1 次提交
  8. 10 4月, 2019 3 次提交
  9. 08 2月, 2019 1 次提交
  10. 04 2月, 2019 1 次提交
  11. 14 12月, 2018 2 次提交
    • D
      Enforce a standard header file guard symbol name · 568a4172
      Daniel P. Berrangé 提交于
      Require that all headers are guarded by a symbol named
      
        LIBVIRT_$FILENAME
      
      where $FILENAME is the uppercased filename, with all characters
      outside a-z changed into '_'.
      
      Note we do not use a leading __ because that is technically a
      namespace reserved for the toolchain.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      568a4172
    • 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
  12. 15 11月, 2018 3 次提交
  13. 17 9月, 2018 1 次提交
  14. 05 9月, 2018 3 次提交
  15. 27 7月, 2018 1 次提交
    • S
      util: pci: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC · 3dee174b
      Sukrit Bhatnagar 提交于
      Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in
      src/util/viralloc.h, define a new wrapper around an existing
      cleanup function which will be called when a variable declared
      with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant
      viralloc.h include, since that has moved from the source module into
      the header.
      
      When variables of types virPCIDevicePtr, virPCIDeviceAddressPtr
      and virPCIEDeviceInfoPtr are declared using VIR_AUTOPTR, the functions
      virPCIDeviceFree, virPCIDeviceAddressFree and virPCIEDeviceInfoFree,
      respectively, will be run automatically on them when they go out of scope.
      Signed-off-by: NSukrit Bhatnagar <skrtbhtngr@gmail.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      3dee174b
  16. 29 1月, 2018 1 次提交
  17. 12 8月, 2017 3 次提交
    • L
      util: save the correct VF's info when using a dual port SRIOV NIC in single port mode · b67eaa63
      Laine Stump 提交于
      Mellanox ConnectX-3 dual port SRIOV NICs present a bit of a challenge
      when assigning one of their VFs to a guest using VFIO device
      assignment.
      
      These NICs have only a single PCI PF device, and that single PF has
      two netdevs sharing the single PCI address - one for port 1 and one
      for port 2. When a VF is created it can also have 2 netdevs, or it can
      be setup in "single port" mode, where the VF has only a single netdev,
      and that netdev is connected either to port 1 or to port 2.
      
      When the VF is created in dual port mode, you get/set the MAC
      address/vlan tag for the port 1 VF by sending a netlink message to the
      PF's port1 netdev, and you get/set the MAC address/vlan tag for the
      port 2 VF by sending a netlink message to the PF's port 2 netdev. (Of
      course libvirt doesn't have any way to describe MAC/vlan info for 2
      ports in a single hostdev interface, so that's a bit of a moot point)
      
      When the VF is created in single port mode, you can *set* the MAC/vlan
      info by sending a netlink message to *either* PF netdev - the driver
      is smart enough to understand that there's only a single netdev, and
      set the MAC/vlan for that netdev. When you want to *get* it, however,
      the driver is more accurate - it will return 00:00:00:00:00:00 for the
      MAC if you request it from the port 1 PF netdev when the VF was
      configured to be single port on port 2, or if you request if from the
      port 2 PF netdev when the VF was configured to be single port on port
      1.
      
      Based on this information, when *getting* the MAC/vlan info (to save
      the original setting prior to assignment), we determine the correct PF
      netdev by matching phys_port_id between VF and PF.
      
      (IMPORTANT NOTE: this implies that to do PCI device assignment of the
      VFs on dual port Mellanox cards using <interface type='hostdev'>
      (i.e. if you want the MAC address/vlan tag to be set), not only must
      the VFs be configured in single port mode, but also the VFs *must* be
      bound to the host VF net driver, and libvirt must use managed='yes')
      
      By the time libvirt is ready to set the new MAC/vlan tag, the VF has
      already been unbound from the host net driver and bound to
      vfio-pci. This isn't problematic though because, as stated earlier,
      when a VF is created in single port mode, commands to configure it can
      be sent to either the port 1 PF netdev or the port 2 PF netdev.
      
      When it is time to restore the original MAC/vlan tag, again the VF
      will *not* be bound to a host net driver, so it won't be possible to
      learn from sysfs whether to use the port 1 or port 2 PF netdev for the
      netlink commands. And again, it doesn't matter which netdev you
      use. However, we must keep in mind that we saved the original settings
      to a file called "${PF}_${VFNUM}". To solve this problem, we just
      check for the existence of ${PF1}_${VFNUM} and ${PF2}_${VFNUM}, and
      use whichever one we find (since we know that only one can be there)
      b67eaa63
    • L
      util: make virPCIGetNetName() more versatile · b3b5aa75
      Laine Stump 提交于
      A single PCI device may have multiple netdevs associated with it. Each
      of those netdevs will have a different phys_port_id entry in
      sysfs. This patch modifies virPCIGetNetName() to allow selecting one
      of the potential many netdevs in two different ways:
      
      1) by setting the "idx" argument, the caller can select the 1st (0),
      2nd (1), etc. netdev from the PCI device's net subdirectory.
      
      2) If the physPortID arg is set (to a null-terminated string) then
      virPCIGetNetName() returns the netdev that has that phys_port_id in
      the sysfs file of the same name in the netdev's directory.
      b3b5aa75
    • L
      util: Fix const'ness of 1st arg to virPCIGetNetName() · 0dc67e6d
      Laine Stump 提交于
      The first arg isn't modified in the function, so it should be const.
      0dc67e6d
  18. 14 4月, 2017 1 次提交
  19. 24 3月, 2017 2 次提交
  20. 01 12月, 2016 1 次提交
    • L
      util: new function virPCIDeviceGetConfigPath() · bfdc1451
      Laine Stump 提交于
      The path to the config file for a PCI device is conventiently stored
      in a virPCIDevice object, but that object's contents aren't directly
      visible outside of virpci.c, so we need to have an accessor function
      for it if anyone needs to look at it.
      bfdc1451
  21. 02 5月, 2016 1 次提交
    • M
      Change virDevicePCIAddress to virPCIDeviceAddress · c36b1f7b
      Martin Kletzander 提交于
      We had both and the only difference was that the latter also included
      information about multifunction setting.  The problem with that was that
      we couldn't use functions made for only one of the structs (e.g.
      parsing).  To consolidate those two structs, use the one in virpci.h,
      include that in domain_conf.h and add the multifunction member in it.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      c36b1f7b
  22. 19 3月, 2016 1 次提交
  23. 29 1月, 2016 1 次提交
    • A
      pci: Use bool return type for some virPCIDeviceGet*() functions · 11ef5869
      Andrea Bolognani 提交于
      The affected functions are:
      
        virPCIDeviceGetManaged()
        virPCIDeviceGetUnbindFromStub()
        virPCIDeviceGetRemoveSlot()
        virPCIDeviceGetReprobe()
      
      Change their return type from unsigned int to bool: the corresponding
      members in struct _virPCIDevice are defined as bool, and even the
      corresponding virPCIDeviceSet*() functions take a bool value as input
      so there's no point in these functions having unsigned int as return
      type.
      Suggested-by: NJohn Ferlan <jferlan@redhat.com>
      11ef5869
  24. 28 1月, 2016 1 次提交
  25. 05 1月, 2016 1 次提交
    • L
      util: reduce debug log in virPCIGetVirtualFunctions() · 3d64a9d7
      Laine Stump 提交于
      Due to debug logs like this:
      
        virPCIGetDeviceAddressFromSysfsLink:2432 : Attempting to resolve device path from device link '/sys/class/net/eth1/device/virtfn6'
        logStrToLong_ui:2369 : Converted '0000:07:00.7' to unsigned int 0
        logStrToLong_ui:2369 : Converted '07:00.7' to unsigned int 7
        logStrToLong_ui:2369 : Converted '00.7' to unsigned int 0
        logStrToLong_ui:2369 : Converted '7' to unsigned int 7
        virPCIGetDeviceAddressFromSysfs:1947 : virPCIDeviceAddress 0000:07:00.7
        virPCIGetVirtualFunctions:2554 : Found virtual function 7
      
      printed *once for each SR-IOV Virtual Function* of a Physical Function
      each time libvirt retrieved the list of VFs (so if the system has 128
      VFs, there would be 900 lines of log for each call), the debug logs on
      any system with a large number of VFs was dominated by "information"
      that was possibly useful for debugging when the code was being
      written, but is now useless for debugging of any problem on a running
      system, and only serves to obscure the real useful information. This
      overkill has no place in production code, so this patch removes it.
      3d64a9d7