1. 16 10月, 2019 4 次提交
  2. 15 10月, 2019 2 次提交
  3. 10 4月, 2019 1 次提交
  4. 08 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. 24 9月, 2018 1 次提交
  7. 20 9月, 2018 1 次提交
  8. 12 9月, 2018 2 次提交
  9. 14 8月, 2018 3 次提交
  10. 08 8月, 2018 1 次提交
  11. 07 8月, 2018 1 次提交
  12. 19 3月, 2018 1 次提交
    • M
      virNetlinkDumpCommand: Don't leak response buffer · 29d6bb70
      Michal Privoznik 提交于
      ==16451== 32,768 bytes in 2 blocks are definitely lost in loss record 1,007 of 1,013
      ==16451==    at 0x4C2AF0F: malloc (vg_replace_malloc.c:299)
      ==16451==    by 0x7CADB40: nl_recv (in /usr/lib64/libnl-3.so.200.23.0)
      ==16451==    by 0x532DFAC: virNetlinkDumpCommand (virnetlink.c:363)
      ==16451==    by 0x53236AE: virNetDevIPCheckIPv6Forwarding (virnetdevip.c:641)
      ==16451==    by 0xE3E4A1A: networkStartNetworkVirtual (bridge_driver.c:2490)
      ==16451==    by 0xE3E55F5: networkStartNetwork (bridge_driver.c:2832)
      ==16451==    by 0xE3DFFE5: networkAutostartConfig (bridge_driver.c:531)
      ==16451==    by 0x53F47E0: virNetworkObjListForEachHelper (virnetworkobj.c:1412)
      ==16451==    by 0x52FE69F: virHashForEach (virhash.c:606)
      ==16451==    by 0x53F4857: virNetworkObjListForEach (virnetworkobj.c:1439)
      ==16451==    by 0xE3E0BF4: networkStateAutoStart (bridge_driver.c:808)
      ==16451==    by 0x55689CE: virStateInitialize (libvirt.c:758)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      29d6bb70
  13. 16 3月, 2018 1 次提交
  14. 15 3月, 2018 1 次提交
  15. 10 2月, 2018 1 次提交
  16. 18 5月, 2017 2 次提交
  17. 04 4月, 2017 1 次提交
    • J
      util: ignore -Wcast-align in virNetlinkDumpCommand · 04be4111
      Ján Tomko 提交于
      Similar to commit b202c39a ignore the warning that breaks the build
      with clang:
      util/virnetlink.c:365:52: error: cast from 'char *' to 'struct nlmsghdr *'
       increases required alignment from 1 to 4 [-Werror,-Wcast-align]
              for (msg = resp; NLMSG_OK(msg, len); msg = NLMSG_NEXT(msg, len)) {
                                                         ^~~~~~~~~~~~~~~~~~~~
      /usr/include/linux/netlink.h:87:7: note: expanded from macro 'NLMSG_NEXT'
               (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      04be4111
  18. 22 3月, 2017 2 次提交
  19. 27 6月, 2016 1 次提交
    • L
      util: move virNetDevLinkDump to virnetlink.c · 943a400c
      Laine Stump 提交于
      virNetDevLinkDump should have been in virnetlink.c, but that file
      didn't exist yet when the function was created. It didn't really
      matter until now - I found that having virnetlink.h included by
      virnetdev.h caused build problems when trying to #include virnetdev.h
      in a .c file in src/conf (due to missing directory in -I). Rather than
      fix that to further institutionalize the incorrect placement of this
      one function, this patch moves the function.
      943a400c
  20. 22 6月, 2016 1 次提交
  21. 27 1月, 2016 1 次提交
    • L
      util: increase libnl buffer size · 8c70d04b
      Leno Hou 提交于
      In the following cases nl_recv() was returning the error "No buffer
      space available":
      
      * When switching CPUs to offline/online in a system more than 128 cpus
      * When using virsh to destroy domain in a system with many interfaces
      
      This patch sets the buffer size for all netlink sockets created by
      libnl to 128K and turns on message peeking for nl_recv(). This
      eliminates the "No buffer space available" errors seen in the cases
      above, and also preempts other future errors the smaller buffers could
      have caused.
      Signed-off-by: NLeno Hou <houqy@linux.vnet.ibm.com>
      Signed-off-by: NLaine Stump <laine@laine.org>
      8c70d04b
  22. 29 10月, 2015 1 次提交
  23. 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
  24. 27 3月, 2015 2 次提交
    • P
      virnetlink: fix build error · 0614976b
      Pavel Hrdina 提交于
      Commint 0473b45c introduced new function virNetlinkDelLink, but in
      it's counterpart for non-linux platform there should be ATTRIBUTE_UNUSED
      instead of ATTRIBUTE_UNSUPPORTED.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      0614976b
    • L
      util: netlink function to delete any network device · 0473b45c
      Laine Stump 提交于
      libvirt has always used the netlink RTM_DELLINK message to delete
      macvtap/macvlan devices, but it can actually be used to delete other
      types of network devices, such as bonds and bridges. This patch makes
      virNetDevMacVLanDelete() available as a generic function so it can
      intelligibly be called to delete these other types of interfaces.
      0473b45c
  25. 06 1月, 2015 2 次提交
    • E
      virnetlink: fix build on non-Linux · 08eb2821
      Eric Blake 提交于
      Commit 4dc04d3a added virNetlinkGetErrorCode, but forgot to provide
      a fallback, which kills the build on mingw (among others):
      
        CCLD     libvirt.la
        Cannot export virNetlinkGetErrorCode: symbol not defined
        collect2: error: ld returned 1 exit status
      
      * src/util/virnetlink.c (virNetlinkGetErrorCode): Provide fallback.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      08eb2821
    • C
      virNetDevSetIPv4Address: libnl implementation · 4dc04d3a
      Cédric Bosdonnat 提交于
      Add a default implementation of virNetDevSetIPv4Address using netlink
      and libnl. This avoids requiring /usr/sbin/ip or /usr/sbin/ifconfig
      external binaries.
      4dc04d3a
  26. 29 10月, 2014 1 次提交
    • E
      maint: avoid static zero init in core files · 39871fce
      Eric Blake 提交于
      C guarantees that static variables are zero-initialized.  Some older
      compilers (and also gcc -fno-zero-initialized-in-bss) create larger
      binaries if you explicitly zero-initialize a static variable.
      
      * src/libvirt.c: Fix initialization.
      * src/util/viralloc.c: Likewise.
      * src/util/virdbus.c: Likewise.
      * src/util/virevent.c: Likewise.
      * src/util/virfile.c (safezero): Likewise.
      * src/util/virlog.c: Likewise.
      * src/util/virnetlink.c: Likewise.
      * src/util/virthread.h (VIR_ONCE_GLOBAL_INIT): Likewise.
      * src/util/virprocess.c (virProcessGetStartTime): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      39871fce
  27. 20 5月, 2014 1 次提交
    • L
      util: refactor virNetlinkCommand to fix several bugs / style problems · 5d85b8a8
      Laine Stump 提交于
      Inspired by a simpler patch from "Wangrui (K) <moon.wangrui@huawei.com>".
      
      A submitted patch pointed out that virNetlinkCommand() was doing an
      improper typecast of the return value from nl_recv() (int to
      unsigned), causing it to miss error returns, and that even after
      remedying that problem, virNetlinkCommand() was calling VIR_FREE() on
      the pointer returned from nl_recv() (*resp) even if nl_recv() had
      returned an error, and that in this case the pointer was verifiably
      invalid, as it was pointing to memory that had been allocated by
      libnl, but then freed prior to returning the error.
      
      While reviewing this patch, I noticed several other problems with this
      seemingly simple function (at least one of them as serious as the
      problem being reported/fixed by the aforementioned patch), and decided
      they all deserved to be fixed. Here is the list:
      
      1) The return value from nl_recv() must be assigned to an int (rather
         than unsigned int) in order to detect failure.
      
      2) When nl_recv() returns an error or 0, the contents of *resp is
         invalid, and should be simply set to 0, *not* VIR_FREE()'d.
      
      3) When nl_recv() returns 0, errno is not set, so the logged error
         message should not reference errno (it *is* an error though).
      
      4) The first error return from virNetlinkCommand returns -EINVAL,
         incorrectly implying that the caller can expect the return value to
         be of the "-errno" variety, which is not true in any other case.
      
      5) The 2nd error return returns directly with garbage in *resp. While
         the caller should never use *resp in this case, it's still good
         practice to set it to NULL.
      
      6) For the next 5 (!!) error conditions, *resp will contain garbage,
         and virNetlinkCommand() will goto it's cleanup code which will
         VIR_FREE(*resp), almost surely leading to a segfault.
      
      In addition to fixing these 6 problems, this patch also makes the
      following two changes to make the function conform more closely to the
      style of other libvirt code:
      
      1) Change the handling of return code from "named rc and defaulted to
      0, but changed to -1 on error" to the more common "named ret and
      defaulted to -1, but changed to 0 on success".
      
      2) Rename the "error" label to "cleanup", since the code that follows
      is executed in success cases as well as failure.
      5d85b8a8
  28. 25 3月, 2014 1 次提交
  29. 18 3月, 2014 1 次提交