1. 16 4月, 2013 1 次提交
  2. 21 12月, 2012 2 次提交
  3. 21 9月, 2012 1 次提交
  4. 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
  5. 22 4月, 2012 1 次提交
    • M
      win32: Properly handle TlsGetValue returning NULL · e0aba54b
      Matthias Bolte 提交于
      virThreadSelf tries to access the virThreadPtr stored in TLS for the
      current thread via TlsGetValue. When virThreadSelf is called on a thread
      that was not created via virThreadCreate (e.g. the main thread) then
      TlsGetValue returns NULL as TlsAlloc initializes TLS slots to NULL.
      
      virThreadSelf can be called on the main thread via this call chain from
      virsh
      
      vshDeinit
      virEventAddTimeout
      virEventPollAddTimeout
      virEventPollInterruptLocked
      virThreadIsSelf
      
      triggering a segfault as virThreadSelf unconditionally dereferences the
      return value of TlsGetValue.
      
      Fix this by making virThreadSelf check the TLS slot value for NULL and
      setting the given virThreadPtr accordingly.
      
      Reported by Marcel Müller.
      e0aba54b
  6. 26 1月, 2012 1 次提交
  7. 20 1月, 2012 1 次提交
    • E
      threads: check for failure to set thread-local value · 927cfaf4
      Eric Blake 提交于
      We had a memory leak on a very arcane OOM situation (unlikely to ever
      hit in practice, but who knows if libvirt.so would ever be linked
      into some other program that exhausts all thread-local storage keys?).
      I found it by code inspection, while analyzing a valgrind report
      generated by Alex Jia.
      
      * src/util/threads.h (virThreadLocalSet): Alter signature.
      * src/util/threads-pthread.c (virThreadHelper): Reduce allocation
      lifetime.
      (virThreadLocalSet): Detect failure.
      * src/util/threads-win32.c (virThreadLocalSet): Likewise.
      (virCondWait): Fix caller.
      * src/util/virterror.c (virLastErrorObject): Likewise.
      927cfaf4
  8. 25 4月, 2011 1 次提交
    • E
      threads: add one-time initialization support · 99de5990
      Eric Blake 提交于
      mingw lacks the counterpart to PTHREAD_MUTEX_INITIALIZER, so the
      best we can do is portably expose once-only runtime initialization.
      
      * src/util/threads.h (virOnceControlPtr): New opaque type.
      (virOnceFunc): New callback type.
      (virOnce): New prototype.
      * src/util/threads-pthread.h (virOnceControl): Declare.
      (VIR_ONCE_CONTROL_INITIALIZER): Define.
      * src/util/threads-win32.h (virOnceControl)
      (VIR_ONCE_CONTROL_INITIALIZER): Likewise.
      * src/util/threads-pthread.c (virOnce): Implement in pthreads.
      * src/util/threads-win32.c (virOnce): Implement in WIN32.
      * src/libvirt_private.syms: Export it.
      99de5990
  9. 06 4月, 2011 1 次提交
    • D
      Avoid compiler warnings about int -> void * casts · 5b099250
      Daniel P. Berrange 提交于
      GCC is a little confused about the cast of beginthread/beginthreadex
      from unsigned long -> void *. Go via an intermediate variable avoids
      the bogus warning, and makes the code a little cleaner
      
      * src/util/threads-win32.c: Avoid compiler warning in cast
      5b099250
  10. 07 12月, 2010 1 次提交
    • E
      threads: add virThreadID for debugging use · e4bc372e
      Eric Blake 提交于
      * src/util/threads.h (virThreadID): New prototype.
      * src/util/threads-pthread.c (virThreadID): New function.
      * src/util/threads-win32.c (virThreadID): Likewise.
      * src/libvirt_private.syms (threads.h): Export it.
      * daemon/event.c (virEventInterruptLocked): Use it to avoid
      warning on BSD systems.
      e4bc372e
  11. 02 12月, 2010 1 次提交
    • D
      Fix flaw in thread creation APIs · 9c656092
      Daniel P. Berrange 提交于
      The arguments passed to the thread function must be allocated on
      the heap, rather than the stack, since it is possible for the
      spawning thread to continue before the new thread runs at all.
      In such a case, it is possible that the area of stack where the
      thread args were stored is overwritten.
      
      * src/util/threads-pthread.c, src/util/threads-win32.c: Allocate
        thread arguments on the heap
      9c656092
  12. 23 11月, 2010 1 次提交
    • D
      Include a thread identifier in log messages · 9288c31b
      Daniel P. Berrange 提交于
      To allow messages from different threads to be untangled,
      include an integer thread identifier in log messages.
      
      * src/util/logging.c: Include thread ID
      * src/util/threads.h, src/util/threads.h, src/util/threads-pthread.c:
        Add new virThreadSelfID() function
      * configure.ac: Check for sys/syscall.h
      9288c31b
  13. 12 11月, 2010 1 次提交
    • D
      Introduce portability APIs for creating threads · 64d67507
      Daniel P. Berrange 提交于
      The util/threads.c/h code already has APIs for mutexes,
      condition variables and thread locals. This commit adds
      in code for actually creating threads.
      
      * src/libvirt_private.syms: Export new symbols
      * src/util/threads.h: Define APIs virThreadCreate, virThreadSelf,
        virThreadIsSelf and virThreadJoin
      * src/util/threads-win32.c, src/util/threads-win32.h: Win32
        impl of threads
      * src/util/threads-pthread.c, src/util/threads-pthread.h: POSIX
        impl of threads
      64d67507
  14. 10 6月, 2010 1 次提交
    • E
      build: avoid pthreads-win32 on mingw · 6e5a04f0
      Eric Blake 提交于
      * src/util/threads.c (includes) [WIN32]: On mingw, favor native
      threading over pthreads-win32 library.
      * src/util/thread.h [WIN32] Likewise.
      Suggested by Daniel P. Berrange.
      6e5a04f0
  15. 04 5月, 2010 1 次提交
    • M
      mingw: Fix two undefined symbols · ee234bfd
      Matthias Bolte 提交于
      Add an empty body for virCondWaitUntil and move virPipeReadUntilEOF
      out of the '#ifndef WIN32' block, because it compiles fine with MinGW
      in combination with gnulib.
      ee234bfd
  16. 08 4月, 2010 1 次提交
    • D
      Fix Win32 portability problems · 3d3af088
      Daniel P. Berrange 提交于
      The network filter / snapshot / hooks code introduced some
      non-portable pices that broke the win32 build
      
      * configure.ac: Check for net/ethernet.h required by nwfile config
         parsing code
      * src/conf/nwfilter_conf.c: Define ethernet protocol  constants
        if net/ethernet.h is missing
      * src/util/hooks.c: Disable hooks build on Win32 since it lacks
        fork/exec/pipe
      * src/util/threads-win32.c: Fix unchecked return value
      * tools/virsh.c: Disable SIGPIPE on Win32 since it doesn't exist.
        Fix non-portable strftime() formats
      3d3af088
  17. 27 3月, 2010 1 次提交
    • S
      Add recursive locks · f895e611
      Stefan Berger 提交于
      This patch adds recursive locks necessary due to the processing of
      network filter XML that can reference other network filters, including
      references that cause looks. Loops in the XML are prevented but their
      detection requires recursive locks.
      Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
      f895e611
  18. 21 9月, 2009 1 次提交
    • D
      Move all shared utility files to src/util/ · 1355e055
      Daniel P. Berrange 提交于
      * src/bridge.c, src/bridge.h, src/buf.c, src/buf.h, src/cgroup.c,
        src/cgroup.h, src/conf.c, src/conf.h, src/event.c, src/event.h,
        src/hash.c, src/hash.h, src/hostusb.c, src/hostusb.h,
        src/iptables.c, src/iptables.h, src/logging.c, src/logging.h,
        src/memory.c, src/memory.h, src/pci.c, src/pci.h, src/qparams.c,
        src/qparams.h, src/stats_linux.c, src/stats_linux.h,
        src/threads-pthread.c, src/threads-pthread.h, src/threads-win32.c,
        src/threads-win32.h, src/threads.c, src/threads.h, src/util.c,
        src/util.h, src/uuid.c, src/uuid.h, src/virterror.c,
        src/virterror_internal.h, src/xml.c, src/xml.h: Move all files
        into src/util/
      * daemon/Makefile.am: Add -Isrc/util/ to build flags
      * src/Makefile.am: Add -Isrc/util/ to build flags and update for
        moved files
      * src/libvirt_private.syms: Export cgroup APIs since they're now
        in util rather than linking directly to drivers
      * src/xen/xs_internal.c: Disable bogus virEventRemoveHandle call
        when built under PROXY
      * proxy/Makefile.am: Update for changed file locations. Remove
        bogus build of event.c
      * tools/Makefile.am, tests/Makefile.am: Add -Isrc/util/ to build flags
      1355e055
  19. 23 7月, 2009 1 次提交
    • D
      Fix misc Win32 compile warnings · 899ae0d2
      Daniel P. Berrange 提交于
      GCC >= 4.4 assumes the 'printf' attribute refers to the native
      runtime libraries format specifiers. Thanks to gnulib, libvirt
      has GNU format specifiers everywhere.  This means we need to
      use 'gnu_printf' with GCC >= 4.4 to get correct compiler
      checking of printf format specifiers.
      
      * HACKING: Document new rules for ATTRIBUTE_FMT_PRINTF
      * autobuild.sh, mingw32-libvirt.spec.in: Disable OpenNebula
        driver on mingw32 builds
      * qemud/dispatch.h, qemud/qemu.h, src/buf.h src/internal.h,
        src/logging.h, src/security.h, src/sexpr.h, src/util.h,
        src/virterror_internal.h, src/xend_internal.c: Change
        over to ATTRIBUTE_FMT_PRINTF.
      * src/virsh.c: Disable 'cd' and 'pwd' commands on Win32
        since they don't compile
      * src/threads-win32.c: Add missing return value check
      899ae0d2
  20. 16 1月, 2009 1 次提交