1. 15 10月, 2014 1 次提交
  2. 05 9月, 2014 1 次提交
    • E
      maint: use consistent if-else braces in remaining spots · d194d6e7
      Eric Blake 提交于
      I'm about to add a syntax check that enforces our documented
      HACKING style of always using matching {} on if-else statements.
      
      This patch focuses on all remaining problems, where there weren't
      enough issues to warrant splitting it further.
      
      * src/remote/remote_driver.c (doRemoteOpen): Correct use of {}.
      * src/security/virt-aa-helper.c (vah_add_path, valid_path, main):
      Likewise.
      * src/rpc/virnetsocket.c (virNetSocketNewConnectLibSSH2):
      Likewise.
      * src/esx/esx_vi_types.c (esxVI_Type_FromString): Likewise.
      * src/uml/uml_driver.c (umlDomainDetachDevice): Likewise.
      * src/util/viralloc.c (virShrinkN): Likewise.
      * src/util/virbuffer.c (virBufferURIEncodeString): Likewise.
      * src/util/virdbus.c (virDBusCall): Likewise.
      * src/util/virnetdev.c (virNetDevValidateConfig): Likewise.
      * src/util/virnetdevvportprofile.c
      (virNetDevVPortProfileGetNthParent): Likewise.
      * src/util/virpci.c (virPCIDeviceIterDevices)
      (virPCIDeviceWaitForCleanup)
      (virPCIDeviceIsBehindSwitchLackingACS): Likewise.
      * src/util/virsocketaddr.c (virSocketAddrGetNumNetmaskBits):
      Likewise.
      * src/util/viruri.c (virURIParseParams): Likewise.
      * daemon/stream.c (daemonStreamHandleAbort): Likewise.
      * tests/testutils.c (virtTestResult): Likewise.
      * tests/cputest.c (cpuTestBaseline): Likewise.
      * tools/virsh-domain.c (cmdDomPMSuspend): Likewise.
      * tools/virsh-host.c (cmdNodeSuspend): Likewise.
      * src/esx/esx_vi_generator.py (Type.generate_typefromstring):
      Tweak generated code.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d194d6e7
  3. 25 3月, 2014 1 次提交
  4. 21 3月, 2014 1 次提交
  5. 20 3月, 2014 1 次提交
    • D
      Fix unitialized data in virSocketAddrMask · ba08c593
      Daniel P. Berrange 提交于
      The virSocketAddrMask method did not initialize all fields
      in the sockaddr_in6 struct. In paticular the 'sin6_scope_id'
      field could contain random garbage, which would in turn
      affect the result of any later virSocketAddrFormat calls.
      This led to ip6tables rules in the FORWARD chain which
      matched on random garbage sin6_scope_id. Fortunately these
      were ACCEPT rules, so the impact was merely that desired
      traffic was blocked, rather than undesired traffic allowed.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ba08c593
  6. 15 10月, 2013 1 次提交
    • E
      maint: avoid 'const fooPtr' in several util files · 1b0bc416
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in src/util outside of the virnet namespace.
      
      Also, make a few virSocketAddr functions const-correct, for easier
      conversions in future patches.
      
      * src/util/virbuffer.h (virBufferError, virBufferUse)
      (virBufferGetIndent): Use intended type.
      * src/util/virmacaddr.h (virMacAddrCmp, virMacAddrCmpRaw)
      (virMacAddrSet, virMcAddrFormat, virMacAddrIsUnicast)
      (virMacAddrIsMulticast): Likewise.
      * src/util/virebtables.h (ebtablesAddForwardAllowIn)
      (ebtablesRemoveForwardAllowIn): Likewise.
      * src/util/virsocketaddr.h (virSocketAddrSetIPv4Addr): Drop
      incorrect const.
      (virMacAddrGetRaw, virSocketAddrFormat, virSocketAddrFormatFull):
      Make const-correct.
      (virSocketAddrMask, virSocketAddrMaskByPrefix)
      (virSocketAddrBroadcast, virSocketAddrBroadcastByPrefix)
      (virSocketAddrGetNumNetmaskBits, virSocketAddrGetIpPrefix)
      (virSocketAddrEqual, virSocketAddrIsPrivate)
      (virSocketAddrIsWildcard): Use intended type.
      * src/util/virbuffer.c (virBufferError, virBufferUse)
      (virBufferGetIndent): Fix fallout.
      * src/util/virmacaddr.c (virMacAddrCmp, virMacAddrCmpRaw)
      (virMacAddrSet, virMcAddrFormat, virMacAddrIsUnicast)
      (virMacAddrIsMulticast): Likewise.
      * src/util/virebtables.c (ebtablesAddForwardAllowIn)
      (ebtablesRemoveForwardAllowIn): Likewise.
      * src/util/virsocketaddr.c (virSocketAddrMask, virMacAddrGetRaw)
      (virSocketAddrMaskByPrefix, virSocketAddrBroadcast)
      (virSocketAddrBroadcastByPrefix, virSocketAddrGetNumNetmaskBits)
      (virSocketAddrGetIpPrefix, virSocketAddrEqual)
      (virSocketAddrIsPrivate, virSocketAddrIsWildcard)
      (virSocketAddrGetIPv4Addr, virSocketAddrGetIPv6Addr)
      (virSocketAddrFormat, virSocketAddrFormatFull): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1b0bc416
  7. 11 10月, 2013 1 次提交
  8. 11 7月, 2013 1 次提交
  9. 10 7月, 2013 1 次提交
  10. 28 6月, 2013 1 次提交
  11. 10 6月, 2013 1 次提交
  12. 07 6月, 2013 1 次提交
  13. 28 5月, 2013 1 次提交
    • E
      syntax: prefer space after semicolon in for loop · 146ba114
      Eric Blake 提交于
      I noticed several unusual spacings in for loops, and decided to
      fix them up.  See the next commit for the syntax check that found
      all of these.
      
      * examples/domsuspend/suspend.c (main): Fix spacing.
      * python/libvirt-override.c: Likewise.
      * src/conf/interface_conf.c: Likewise.
      * src/security/virt-aa-helper.c: Likewise.
      * src/util/virconf.c: Likewise.
      * src/util/virhook.c: Likewise.
      * src/util/virlog.c: Likewise.
      * src/util/virsocketaddr.c: Likewise.
      * src/util/virsysinfo.c: Likewise.
      * src/util/viruuid.c: Likewise.
      * src/vbox/vbox_tmpl.c: Likewise.
      * src/xen/xen_hypervisor.c: Likewise.
      * tools/virsh-domain-monitor.c (vshDomainStateToString): Drop
      default case, to let compiler check us.
      * tools/virsh-domain.c (vshDomainVcpuStateToString): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      146ba114
  14. 24 5月, 2013 1 次提交
  15. 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
  16. 23 4月, 2013 1 次提交
  17. 30 1月, 2013 1 次提交
  18. 21 12月, 2012 2 次提交
  19. 30 11月, 2012 1 次提交
    • L
      util: new virSocketAddrIsPrivate function · bf402e77
      Laine Stump 提交于
      This new function returns true if the given address is in the range of
      any "private" or "local" networks as defined in RFC1918 (IPv4) or
      RFC3484/RFC4193 (IPv6), otherwise they return false.
      
      These ranges are:
      
         192.168.0.0/16
         172.16.0.0/16
         10.0.0.0/24
         FC00::/7
         FEC0::/10
      bf402e77
  20. 02 11月, 2012 1 次提交
  21. 12 10月, 2012 1 次提交
  22. 21 9月, 2012 1 次提交
  23. 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
  24. 18 7月, 2012 1 次提交
  25. 25 4月, 2012 1 次提交
    • S
      Add new functions to virSocketAddr · 1614970e
      Stefan Berger 提交于
      Add 2 new functions to the virSocketAddr 'class':
      
      - virSocketAddrEqual: tests whether two IP addresses and their ports are equal
      - virSocketaddSetIPv4Addr: set a virSocketAddr given a 32 bit int
      1614970e
  26. 27 3月, 2012 1 次提交
    • M
      Cleanup for a return statement in source files · 9943276f
      Martin Kletzander 提交于
      Return statements with parameter enclosed in parentheses were modified
      and parentheses were removed. The whole change was scripted, here is how:
      
      List of files was obtained using this command:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$'
      
      Found files were modified with this command:
      sed -i -e                                                                 \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      
      Then checked for nonsense.
      
      The whole command looks like this:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      9943276f
  27. 15 11月, 2011 1 次提交
    • D
      Split src/util/network.{c,h} into 5 pieces · d3406045
      Daniel P. Berrange 提交于
      The src/util/network.c file is a dumping ground for many different
      APIs. Split it up into 5 pieces, along functional lines
      
       - src/util/virnetdevbandwidth.c: virNetDevBandwidth type & helper APIs
       - src/util/virnetdevvportprofile.c: virNetDevVPortProfile type & helper APIs
       - src/util/virsocketaddr.c: virSocketAddr and APIs
       - src/conf/netdev_bandwidth_conf.c: XML parsing / formatting
         for virNetDevBandwidth
       - src/conf/netdev_vport_profile_conf.c: XML parsing / formatting
         for virNetDevVPortProfile
      
      * src/util/network.c, src/util/network.h: Split into 5 pieces
      * src/conf/netdev_bandwidth_conf.c, src/conf/netdev_bandwidth_conf.h,
        src/conf/netdev_vport_profile_conf.c, src/conf/netdev_vport_profile_conf.h,
        src/util/virnetdevbandwidth.c, src/util/virnetdevbandwidth.h,
        src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h,
        src/util/virsocketaddr.c, src/util/virsocketaddr.h: New pieces
      * daemon/libvirtd.h, daemon/remote.c, src/conf/domain_conf.c,
        src/conf/domain_conf.h, src/conf/network_conf.c,
        src/conf/network_conf.h, src/conf/nwfilter_conf.h,
        src/esx/esx_util.h, src/network/bridge_driver.c,
        src/qemu/qemu_conf.c, src/rpc/virnetsocket.c,
        src/rpc/virnetsocket.h, src/util/dnsmasq.h, src/util/interface.h,
        src/util/iptables.h, src/util/macvtap.c, src/util/macvtap.h,
        src/util/virnetdev.h, src/util/virnetdevtap.c,
        tools/virsh.c: Update include files
      d3406045