1. 03 12月, 2014 1 次提交
    • J
      Replace virNWFilterFree with virObjectUnref · 7b4938f5
      John Ferlan 提交于
      Since virNWFilterFree will call virObjectUnref anyway, let's just use that
      directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      7b4938f5
  2. 25 3月, 2014 1 次提交
  3. 21 3月, 2014 1 次提交
  4. 18 3月, 2014 1 次提交
  5. 17 3月, 2014 2 次提交
  6. 10 3月, 2014 1 次提交
    • D
      Add a mutex to serialize updates to firewall · 925de19e
      Daniel P. Berrange 提交于
      The nwfilter conf update mutex previously serialized
      updates to the internal data structures for firewall
      rules, and updates to the firewall itself. The latter
      was recently turned into a read/write lock, and filter
      instantiation allowed to proceed in parallel. It was
      believed that this was ok, since each filter is created
      on a separate iptables/ebtables chain.
      
      It turns out that there is a subtle lock ordering problem
      on virNWFilterObjPtr instances. __virNWFilterInstantiateFilter
      will hold a lock on the virNWFilterObjPtr it is instantiating.
      This in turn invokes virNWFilterInstantiate which then invokes
      virNWFilterDetermineMissingVarsRec which then invokes
      virNWFilterObjFindByName. This iterates over every single
      virNWFilterObjPtr in the list, locking them and checking their
      name. So if 2 or more threads try to instantiate a filter in
      parallel, they'll all hold 1 lock at the top level in the
      __virNWFilterInstantiateFilter method which will cause the
      other thread to deadlock in virNWFilterObjFindByName.
      
      The fix is to add an exclusive mutex to serialize the
      execution of __virNWFilterInstantiateFilter.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      925de19e
  7. 31 1月, 2014 1 次提交
    • D
      Push nwfilter update locking up to top level · 6e5c79a1
      Daniel P. Berrange 提交于
      The NWFilter code has as a deadlock race condition between
      the virNWFilter{Define,Undefine} APIs and starting of guest
      VMs due to mis-matched lock ordering.
      
      In the virNWFilter{Define,Undefine} codepaths the lock ordering
      is
      
        1. nwfilter driver lock
        2. virt driver lock
        3. nwfilter update lock
        4. domain object lock
      
      In the VM guest startup paths the lock ordering is
      
        1. virt driver lock
        2. domain object lock
        3. nwfilter update lock
      
      As can be seen the domain object and nwfilter update locks are
      not acquired in a consistent order.
      
      The fix used is to push the nwfilter update lock upto the top
      level resulting in a lock ordering for virNWFilter{Define,Undefine}
      of
      
        1. nwfilter driver lock
        2. nwfilter update lock
        3. virt driver lock
        4. domain object lock
      
      and VM start using
      
        1. nwfilter update lock
        2. virt driver lock
        3. domain object lock
      
      This has the effect of serializing VM startup once again, even if
      no nwfilters are applied to the guest. There is also the possibility
      of deadlock due to a call graph loop via virNWFilterInstantiate
      and virNWFilterInstantiateFilterLate.
      
      These two problems mean the lock must be turned into a read/write
      lock instead of a plain mutex at the same time. The lock is used to
      serialize changes to the "driver->nwfilters" hash, so the write lock
      only needs to be held by the define/undefine methods. All other
      methods can rely on a read lock which allows good concurrency.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      6e5c79a1
  8. 04 12月, 2013 1 次提交
    • J
      nwfilter: Remove Coverity DEADCODE warning · 5a298ec0
      John Ferlan 提交于
      The nwfilterStateInitialize() would only assign sysbus inside
      a WITH_DBUS conditional, thus leaving a subsequent check for sysbus
      and nwfilterDriverInstallDBusMatches() as a no-op
      
      Rather than try to add WITH_DBUS conditions which ended up conflicting
      with the usage of HAVE_FIREWALLD conditionals, just remove the WITH_DBUS
      since virdbus.c has entry points for with and without conditions.
      5a298ec0
  9. 13 11月, 2013 1 次提交
    • J
      Disable nwfilter driver when running unprivileged · b7829f95
      Ján Tomko 提交于
      When opening a new connection to the driver, nwfilterOpen
      only succeeds if the driverState has been allocated.
      
      Move the privilege check in driver initialization before
      the state allocation to disable the driver.
      
      This changes the nwfilter-define error from:
      error: cannot create config directory (null): Bad address
      To:
      this function is not supported by the connection driver:
      virNWFilterDefineXML
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1029266
      b7829f95
  10. 14 10月, 2013 1 次提交
    • D
      Don't ignore all dbus connection errors · 6bd88600
      Daniel P. Berrange 提交于
      Previous commit
      
        commit 7ada155c
        Author: Gao feng <gaofeng@cn.fujitsu.com>
        Date:   Wed Sep 11 11:15:02 2013 +0800
      
          DBus: introduce virDBusIsServiceEnabled
      
      Made the cgroups code fallback to non-systemd based setup
      when dbus is not running. It was too big a hammer though,
      as it did not check what error code was received when the
      dbus connection failed. Thus it silently ignored serious
      errors from dbus such as "too many client connections",
      which should always be treated as fatal.
      
      We only want to ignore errors if the dbus unix socket does
      not exist, or if nothing is listening on it.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      6bd88600
  11. 07 10月, 2013 3 次提交
  12. 19 8月, 2013 1 次提交
  13. 11 7月, 2013 1 次提交
  14. 10 7月, 2013 1 次提交
  15. 03 7月, 2013 1 次提交
  16. 24 6月, 2013 1 次提交
  17. 05 6月, 2013 1 次提交
    • S
      nwfilter: grab driver lock earlier during init (bz96649) · 0ec376c2
      Stefan Berger 提交于
      This patch is in relation to Bug 966449:
      
      https://bugzilla.redhat.com/show_bug.cgi?id=966449
      
      This is a patch addressing the coredump.
      
      Thread 1 must be calling  nwfilterDriverRemoveDBusMatches(). It does so with
      nwfilterDriverLock held. In the patch below I am now moving the
      nwfilterDriverLock(driverState) further up so that the initialization, which
      seems to either take a long time or is entirely stuck, occurs with the lock
      held and the shutdown cannot occur at the same time. 
      
      Remove the lock in virNWFilterDriverIsWatchingFirewallD to avoid
      double-locking.
      0ec376c2
  18. 21 5月, 2013 1 次提交
  19. 09 5月, 2013 1 次提交
  20. 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
  21. 24 4月, 2013 3 次提交
  22. 23 1月, 2013 1 次提交
    • D
      Fix nwfilter driver reload/shutdown handling when unprivileged · abbec81b
      Daniel P. Berrange 提交于
      Although the nwfilter driver skips startup when running in a
      session libvirtd, it did not skip reload or shutdown. This
      caused errors to be reported when sending SIGHUP to libvirtd,
      and caused an abort() in libdbus on shutdown due to trying
      to remove a dbus filter that was never added
      abbec81b
  23. 14 1月, 2013 1 次提交
  24. 09 1月, 2013 1 次提交
  25. 21 12月, 2012 3 次提交
  26. 04 12月, 2012 2 次提交
  27. 30 11月, 2012 2 次提交
  28. 02 11月, 2012 1 次提交
  29. 21 9月, 2012 1 次提交
  30. 17 9月, 2012 1 次提交
  31. 29 8月, 2012 1 次提交