1. 04 2月, 2020 1 次提交
  2. 12 11月, 2019 1 次提交
  3. 16 10月, 2019 2 次提交
  4. 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
  5. 07 8月, 2018 2 次提交
  6. 15 4月, 2015 1 次提交
    • M
      Cleanup "/sys/class/net" usage · 96a21e97
      Michal Privoznik 提交于
      Throughout the code, we have several places need to construct a path
      somewhere in /sys/class/net/... They are not consistent and nearly
      each code piece invents its own way how to do it. So unify this by:
      
      1) use virNetDevSysfsFile() wherever possible
      
      2) At least use common macro SYSFS_NET_DIR declared in virnetdev.h at
         the rest of places which can't go with 1)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      96a21e97
  7. 27 11月, 2014 1 次提交
  8. 25 11月, 2014 1 次提交
    • C
      ip link needs 'name' in 3.16 to create the veth pair · 433b427f
      Cédric Bosdonnat 提交于
      Due to a change (or bug?) in ip link implementation, the command
          'ip link add vnet0...'
      is forced into
          'ip link add name vnet0...'
      The changed command also works on older versions of iproute2, just the
      'name' parameter has been made mandatory.
      433b427f
  9. 08 4月, 2014 1 次提交
  10. 25 3月, 2014 1 次提交
  11. 18 3月, 2014 1 次提交
  12. 04 3月, 2014 1 次提交
    • E
      util: make it easier to grab only regular command exit · b9dd878f
      Eric Blake 提交于
      Auditing all callers of virCommandRun and virCommandWait that
      passed a non-NULL pointer for exit status turned up some
      interesting observations.  Many callers were merely passing
      a pointer to avoid the overall command dying, but without
      caring what the exit status was - but these callers would
      be better off treating a child death by signal as an abnormal
      exit.  Other callers were actually acting on the status, but
      not all of them remembered to filter by WIFEXITED and convert
      with WEXITSTATUS; depending on the platform, this can result
      in a status being reported as 256 times too big.  And among
      those that correctly parse the output, it gets rather verbose.
      Finally, there were the callers that explicitly checked that
      the status was 0, and gave their own message, but with fewer
      details than what virCommand gives for free.
      
      So the best idea is to move the complexity out of callers and
      into virCommand - by default, we return the actual exit status
      already cleaned through WEXITSTATUS and treat signals as a
      failed command; but the few callers that care can ask for raw
      status and act on it themselves.
      
      * src/util/vircommand.h (virCommandRawStatus): New prototype.
      * src/libvirt_private.syms (util/command.h): Export it.
      * docs/internals/command.html.in: Document it.
      * src/util/vircommand.c (virCommandRawStatus): New function.
      (virCommandWait): Adjust semantics.
      * tests/commandtest.c (test1): Test it.
      * daemon/remote.c (remoteDispatchAuthPolkit): Adjust callers.
      * src/access/viraccessdriverpolkit.c (virAccessDriverPolkitCheck):
      Likewise.
      * src/fdstream.c (virFDStreamCloseInt): Likewise.
      * src/lxc/lxc_process.c (virLXCProcessStart): Likewise.
      * src/qemu/qemu_command.c (qemuCreateInBridgePortWithHelper):
      Likewise.
      * src/xen/xen_driver.c (xenUnifiedXendProbe): Simplify.
      * tests/reconnect.c (mymain): Likewise.
      * tests/statstest.c (mymain): Likewise.
      * src/bhyve/bhyve_process.c (virBhyveProcessStart)
      (virBhyveProcessStop): Don't overwrite virCommand error.
      * src/libvirt.c (virConnectAuthGainPolkit): Likewise.
      * src/openvz/openvz_driver.c (openvzDomainGetBarrierLimit)
      (openvzDomainSetBarrierLimit): Likewise.
      * src/util/virebtables.c (virEbTablesOnceInit): Likewise.
      * src/util/viriptables.c (virIpTablesOnceInit): Likewise.
      * src/util/virnetdevveth.c (virNetDevVethCreate): Fix debug
      message.
      * src/qemu/qemu_capabilities.c (virQEMUCapsInitQMP): Add comment.
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSINodeUpdate): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b9dd878f
  13. 26 2月, 2014 1 次提交
    • M
      virNetDevVethCreate: Serialize callers · c0d162c6
      Michal Privoznik 提交于
      Consider dozen of LXC domains, each of them having this type of interface:
      
          <interface type='network'>
            <mac address='52:54:00:a7:05:4b'/>
            <source network='default'/>
          </interface>
      
      When starting these domain in parallel, all workers may meet in
      virNetDevVethCreate() where a race starts. Race over allocating veth
      pairs because allocation requires two steps:
      
        1) find first nonexistent '/sys/class/net/vnet%d/'
        2) run 'ip link add ...' command
      
      Now consider two threads. Both of them find N as the first unused veth
      index but only one of them succeeds allocating it. The other one fails.
      For such cases, we are running the allocation in a loop with 10 rounds.
      However this is very flaky synchronization. It should be rather used
      when libvirt is competing with other process than when libvirt threads
      fight each other. Therefore, internally we should use mutex to serialize
      callers, and do the allocation in loop (just in case we are competing
      with a different process). By the way we have something similar already
      since 1cf97c87.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c0d162c6
  14. 04 10月, 2013 2 次提交
  15. 03 10月, 2013 3 次提交
  16. 10 7月, 2013 1 次提交
  17. 11 5月, 2013 1 次提交
    • L
      util: move virFile* functions from virutil.c to virfile.c · bfe7721d
      Laine Stump 提交于
      These all existed before virfile.c was created, and for some reason
      weren't moved.
      
      This is mostly straightfoward, although the syntax rule prohibiting
      write() had to be changed to have an exception for virfile.c instead
      of virutil.c.
      
      This movement pointed out that there is a function called
      virBuildPath(), and another almost identical function called
      virFileBuildPath(). They really should be a single function, which
      I'll take care of as soon as I figure out what the arglist should look
      like.
      bfe7721d
  18. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  19. 21 12月, 2012 4 次提交
  20. 28 11月, 2012 1 次提交
  21. 21 9月, 2012 1 次提交
  22. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  23. 18 7月, 2012 1 次提交
  24. 15 11月, 2011 2 次提交
    • D
      Move LXC veth.c code into shared utility APIs · 428cffb1
      Daniel P. Berrange 提交于
      Move the virNetDevSetName and virNetDevSetNamespace APIs out
      of LXC's veth.c and into virnetdev.c.
      
      Move the remaining content of the file to src/util/virnetdevveth.c
      
      * src/lxc/veth.c: Rename to src/util/virnetdevveth.c
      * src/lxc/veth.h: Rename to src/util/virnetdevveth.h
      * src/util/virnetdev.c, src/util/virnetdev.h: Add
        virNetDevSetName and virNetDevSetNamespace
      * src/lxc/lxc_container.c, src/lxc/lxc_controller.c,
        src/lxc/lxc_driver.c: Update include paths
      428cffb1
    • D
      Rename the LXC veth management APIs and delete duplicated APIs · 29b242ad
      Daniel P. Berrange 提交于
      The src/lxc/veth.c file contains APIs for managing veth devices,
      but some of the APIs duplicate stuff from src/util/virnetdev.h.
      Delete thed duplicate APIs and rename the remaining ones to
      follow virNetDevVethXXXX
      
      * src/lxc/veth.c, src/lxc/veth.h: Rename APIs & delete duplicates
      * src/lxc/lxc_container.c, src/lxc/lxc_controller.c,
        src/lxc/lxc_driver.c: Update for API renaming
      29b242ad
  25. 02 9月, 2011 1 次提交
    • S
      lxc: do not require 'ifconfig' or 'ipconfig' in container · f0fe28cb
      Scott Moser 提交于
      Currently, the lxc implementation invokes 'ip' and 'ifconfig' commands
      inside a container using 'virRun'.  That has the side effect of requiring
      those commands to be present and to function in a manner consistent with
      the usage.  Some small roots (such as ttylinux) may not have 'ip' or
      'ifconfig'.
      
      This patch replaces the use of these commands with usage of
      netdevice.  The result is that lxc containers do not have to implement
      those commands, and lxc in libvirt is only dependent on the netdevice
      interface.
      
      I've tested this patch locally against the ubuntu libvirt version enough
      to verify its generally sane.  I attempted to build upstream today, but
      failed with:
        /usr/bin/ld:
          ../src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_domain.o):
         undefined reference to symbol 'xmlXPathRegisterNs@@LIBXML2_2.4.30
      
      Thats probably a local issue only, but I wanted to get this patch up and
      see what others thought of it.  This is ubuntu bug
      https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/828211 .
      f0fe28cb
  26. 15 6月, 2011 1 次提交
    • D
      Fix allocation of veth's to not skip an index · b4728dd4
      Daniel P. Berrange 提交于
      The algorithm for autoassigning vethXXX devices, was always
      skipping over the starting dev index when finding a free
      name for the guest device. This should only be done if the host
      device was autoallocated.
      
      * src/lxc/veth.c: Don't skip over veth indexes
      b4728dd4
  27. 08 6月, 2011 1 次提交
  28. 17 4月, 2011 1 次提交
  29. 22 3月, 2011 1 次提交
    • D
      Fix uninitialized variable & error reporting in LXC veth setup · c59176c1
      Daniel P. Berrange 提交于
      THe veth setup in LXC had a couple of flaws, first brInit did
      not report any error when it failed. Second vethCreate() did
      not correctly initialize the variable containing the return
      code, so could report failure even when it succeeded.
      
      * src/lxc/lxc_driver.c: Report error when brInit fails
      * src/lxc/veth.c: Fix uninitialized variable
      c59176c1
  30. 09 3月, 2011 1 次提交
    • C
      Don't overwrite virRun error messages · 91893014
      Cole Robinson 提交于
      virRun gives pretty useful error output, let's not overwrite it unless there
      is a good reason. Some places were providing more information about what
      the commands were _attempting_ to do, however that's usually less useful from
      a debugging POV than what actually happened.
      91893014
  31. 24 2月, 2011 1 次提交