1. 04 5月, 2018 3 次提交
  2. 22 2月, 2018 1 次提交
  3. 27 9月, 2017 1 次提交
  4. 24 5月, 2016 1 次提交
    • M
      nwfilter: fix lock order deadlock · 2f5e24ba
      Maxim Nestratov 提交于
      Below is backtraces of two deadlocked threads:
      
      thread #1:
       virDomainConfVMNWFilterTeardown
         virNWFilterTeardownFilter
             lock updateMutex <------------
             _virNWFilterTeardownFilter
                  try to lock interface <----------
      
      thread #2:
       learnIPAddressThread
          lock interface <-------
          virNWFilterInstantiateFilterLate
              try to lock updateMutex <----------
      
      The problem is fixed by unlocking interface before calling
      virNWFilterInstantiateFilterLate to avoid updateMutex and interface ordering
      deadlocks. Otherwise we are going to instantiate the filter while holding
      interface lock, which will try to lock updateMutex, and if some other thread
      instantiating a filter in parallel is holding updateMutex and is trying to
      lock interface, both will deadlock.
      Also it is safe to unlock interface before virNWFilterInstantiateFilterLate
      because learnIPAddressThread stopped capturing packets and applied necessary
      rules on the interface, while instantiating a new filter doesn't require a
      locked interface.
      Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
      2f5e24ba
  5. 04 11月, 2015 1 次提交
  6. 25 3月, 2015 1 次提交
  7. 15 11月, 2014 1 次提交
  8. 29 10月, 2014 1 次提交
    • E
      maint: avoid static zero init in helpers · ff99c791
      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/conf/nwfilter_conf.c: Fix initialization.
      * src/cpu/cpu_x86.c: Likewise.
      * src/interface/interface_backend_netcf.c: Likewise.
      * src/locking/lock_daemon.c: Likewise.
      * src/locking/lock_driver_lockd.c: Likewise.
      * src/locking/lock_driver_sanlock.c: Likewise.
      * src/network/bridge_driver.c: Likewise.
      * src/node_device/node_device_udev.c: Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c: Likewise.
      * src/rpc/virnetserver.c: Likewise.
      * src/security/security_selinux.c
      (virSecuritySELinuxGenSecurityLabel): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ff99c791
  9. 25 4月, 2014 1 次提交
  10. 08 4月, 2014 1 次提交
  11. 07 4月, 2014 1 次提交
    • E
      hash: add common utility functions · 09567144
      Eric Blake 提交于
      I almost wrote a hash value free function that just called
      VIR_FREE, then realized I couldn't be the first person to
      do that.  Sure enough, it was worth factoring into a common
      helper routine.
      
      * src/util/virhash.h (virHashValueFree): New function.
      * src/util/virhash.c (virHashValueFree): Implement it.
      * src/util/virobject.h (virObjectFreeHashData): New function.
      * src/libvirt_private.syms (virhash.h, virobject.h): Export them.
      * src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit): Use
      common function.
      * src/qemu/qemu_capabilities.c (virQEMUCapsCacheNew): Likewise.
      * src/qemu/qemu_command.c (qemuDomainCCWAddressSetCreate):
      Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorGetBlockInfo): Likewise.
      * src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
      * src/util/virclosecallbacks.c (virCloseCallbacksNew): Likewise.
      * src/util/virkeyfile.c (virKeyFileParseGroup): Likewise.
      * tests/qemumonitorjsontest.c
      (testQemuMonitorJSONqemuMonitorJSONGetBlockInfo): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      09567144
  12. 25 3月, 2014 1 次提交
  13. 21 3月, 2014 1 次提交
  14. 18 3月, 2014 1 次提交
  15. 20 1月, 2014 1 次提交
  16. 21 11月, 2013 1 次提交
    • E
      maint: fix comma style issues: nwfilter · f5690336
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/nwfilter/nwfilter_ebiptables_driver.c: Consistently use
      commas.
      * src/nwfilter/nwfilter_gentech_driver.c: Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c: Likewise.
      * src/conf/nwfilter_conf.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f5690336
  17. 15 10月, 2013 1 次提交
    • E
      maint: avoid 'const fooPtr' in nwfilter files · 1b7ec657
      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 nwfilter code.
      
      This patch does nothing about the stupidity evident in having
      __virNWFilterInstantiateFilter, _virNWFilterInstantiateFilter,
      and virNWFilterInstantiateFilter, which differ only by leading
      underscores, and which infringes on the namespace reserved to
      the implementation - that would need to be a separate cleanup.
      
      * src/nwfilter/nwfilter_dhcpsnoop.h (virNWFilterDHCPSnoopReq): Use
      intended type.
      * src/nwfilter/nwfilter_gentech_driver.h
      (virNWFilterInstantiateFilter)
      (virNWFilterUpdateInstantiateFilter)
      (virNWFilterInstantiataeFilterLate, virNWFilterTeardownFilter)
      (virNWFilterCreateVarHashmap): Likewise.
      * src/nwfilter/nwfilter_learnipaddr.h (virNWFilterLearnIPAddress):
      Likewise.
      * src/conf/nwfilter_conf.h (virNWFilterApplyBasicRules)
      (virNWFilterApplyDHCPOnlyRules): Likewise.
      (virNWFilterDefFormat): Make const-correct.
      * src/conf/nwfilter_params.h (virNWFilterVarValueCopy)
      (virNWFilterVarValueGetSimple, virNWFilterVarValueGetCardinality)
      (virNWFilterVarValueEqual, virNWFilterVarAccessEqual)
      (virNWFilterVarAccessGetVarName, virNWFilterVarAccessGetType)
      (virNWFilterVarAccessGetIterId, virNWFilterVarAccessGetIndex)
      (virNWFilterVarAccessIsAvailable)
      (virNWFilterVarCombIterGetVarValue): Use intended type.
      (virNWFilterVarValueGetNthValue): Make const-correct.
      * src/nwfilter/nwfilter_dhcpsnoop.c (virNWFilterSnoopReqLeaseDel)
      (virNWFilterSnoopIFKeyFMT, virNWFilterDHCPSnoopReq)
      (virNWFilterSnoopPruneIter, virNWFilterSnoopRemAllReqIter)
      (virNWFilterDHCPSnoopReq): Fix fallout.
      * src/nwfilter/nwfilter_gentech_driver.c
      (virNWFilterVarHashmapAddStdValues, virNWFilterCreateVarHashmap)
      (virNWFilterInstantiate, __virNWFilterInstantiateFilter)
      (_virNWFilterInstantiateFilter, virNWFilterInstantiateFilterLate)
      (virNWFilterInstantiateFilter)
      (virNWFilterUpdateInstantiateFilter)
      (virNWFilterRollbackUpdateFilter, virNWFilterTeardownFilter):
      Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnIPAddress):
      Likewise.
      * src/conf/nwfilter_params.c (virNWFilterVarValueCopy)
      (virNWFilterVarValueGetSimple)
      (virNWFilterVarValueGetCardinality, virNWFilterVarValueEqual)
      (virNWFilterVarCombIterAddVariable)
      (virNWFilterVarCombIterGetVarValue, virNWFilterVarValueCompare)
      (virNWFilterFormatParamAttributes, virNWFilterVarAccessEqual)
      (virNWFilterVarAccessGetVarName, virNWFilterVarAccessGetType)
      (virNWFilterVarAccessGetIterId, virNWFilterVarAccessGetIndex)
      (virNWFilterVarAccessGetIntIterId)
      (virNWFilterVarAccessIsAvailable)
      (virNWFilterVarValueGetNthValue): Likewise.
      * src/nwfilter/nwfilter_ebiptables_driver.c (ebtablesApplyBasicRules)
      (ebtablesApplyDHCPOnlyRules, ebiptablesRuleOrderSort)
      (ebiptablesRuleOrderSortPtr): Likewise.
      * src/conf/nwfilter_conf.c (virNWFilterDefEqual)
      (virNWFilterDefFormat): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1b7ec657
  18. 07 10月, 2013 1 次提交
  19. 10 7月, 2013 1 次提交
  20. 31 5月, 2013 1 次提交
  21. 09 5月, 2013 1 次提交
  22. 07 5月, 2013 1 次提交
  23. 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
  24. 08 4月, 2013 1 次提交
    • D
      Disable cast-align warnings in various places · e57aaa6f
      Daniel P. Berrange 提交于
      There are a number of places which generate cast alignment
      warnings, which are difficult or impossible to address. Use
      pragmas to disable the warnings in these few places
      
      conf/nwfilter_conf.c: In function 'virNWFilterRuleDetailsParse':
      conf/nwfilter_conf.c:1806:16: warning: cast increases required alignment of target type [-Wcast-align]
               item = (nwItemDesc *)((char *)nwf + att[idx].dataIdx);
      conf/nwfilter_conf.c: In function 'virNWFilterRuleDefDetailsFormat':
      conf/nwfilter_conf.c:3238:16: warning: cast increases required alignment of target type [-Wcast-align]
               item = (nwItemDesc *)((char *)def + att[i].dataIdx);
      
      storage/storage_backend_mpath.c: In function 'virStorageBackendCreateVols':
      storage/storage_backend_mpath.c:247:17: warning: cast increases required alignment of target type [-Wcast-align]
               names = (struct dm_names *)(((char *)names) + next);
      
      nwfilter/nwfilter_dhcpsnoop.c: In function 'virNWFilterSnoopDHCPDecode':
      nwfilter/nwfilter_dhcpsnoop.c:994:15: warning: cast increases required alignment of target type [-Wcast-align]
               pip = (struct iphdr *) pep->eh_data;
      nwfilter/nwfilter_dhcpsnoop.c:1004:11: warning: cast increases required alignment of target type [-Wcast-align]
           pup = (struct udphdr *) ((char *) pip + (pip->ihl << 2));
      
      nwfilter/nwfilter_learnipaddr.c: In function 'procDHCPOpts':
      nwfilter/nwfilter_learnipaddr.c:327:33: warning: cast increases required alignment of target type [-Wcast-align]
                       uint32_t *tmp = (uint32_t *)&dhcpopt->value;
      nwfilter/nwfilter_learnipaddr.c: In function 'learnIPAddressThread':
      nwfilter/nwfilter_learnipaddr.c:501:43: warning: cast increases required alignment of target type [-Wcast-align]
                           struct iphdr *iphdr = (struct iphdr*)(packet +
      nwfilter/nwfilter_learnipaddr.c:538:43: warning: cast increases required alignment of target type [-Wcast-align]
                           struct iphdr *iphdr = (struct iphdr*)(packet +
      nwfilter/nwfilter_learnipaddr.c:544:48: warning: cast increases required alignment of target type [-Wcast-align]
                               struct udphdr *udphdr= (struct udphdr *)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      e57aaa6f
  25. 21 12月, 2012 5 次提交
  26. 02 11月, 2012 1 次提交
  27. 21 9月, 2012 1 次提交
  28. 31 8月, 2012 1 次提交
  29. 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
  30. 19 7月, 2012 2 次提交
  31. 17 7月, 2012 1 次提交
    • S
      Convert 'raw MAC address' usages to use virMacAddr · 387117ad
      Stefan Berger 提交于
      Introduce new members in the virMacAddr 'class'
      - virMacAddrSet: set virMacAddr from a virMacAddr
      - virMacAddrSetRaw: setting virMacAddr from raw 6 byte MAC address buffer
      - virMacAddrGetRaw: writing virMacAddr into raw 6 byte MAC address buffer
      - virMacAddrCmp: comparing two virMacAddr
      - virMacAddrCmpRaw: comparing a virMacAddr with a raw 6 byte MAC address buffer
      
      then replace raw MAC addresses by replacing
      
      - 'unsigned char *' with virMacAddrPtr
      - 'unsigned char ... [VIR_MAC_BUFLEN]' with virMacAddr
      
      and introduce usage of above functions where necessary.
      387117ad
  32. 15 6月, 2012 1 次提交
  33. 02 6月, 2012 1 次提交
    • S
      nwfilter: move code for IP address map into separate file · 797b4758
      Stefan Berger 提交于
      The goal of this patch is to prepare for support for multiple IP
      addresses per interface in the DHCP snooping code.
      
      Move the code for the IP address map that maps interface names to
      IP addresses into their own file. Rename the functions on the way
      but otherwise leave the code as-is. Initialize this new layer
      separately before dependent layers (iplearning, dhcpsnooping)
      and shut it down after them.
      797b4758