1. 25 3月, 2014 1 次提交
    • S
      osdep: initialize glib threads in all QEMU tools · ae2990c2
      Stefan Hajnoczi 提交于
      glib versions prior to 2.31.0 require an explicit g_thread_init() call
      to enable multi-threading.
      
      Failure to initialize threading causes glib to take single-threaded code
      paths without synchronization.  For example, the g_slice allocator will
      crash due to race conditions.
      
      Fix this for all QEMU tool programs (qemu-nbd, qemu-io, qemu-img) by
      moving the g_thread_init() call from vl.c:main() into a new
      osdep.c:thread_init() constructor function.
      
      thread_init() has __attribute__((constructor)) and is automatically
      invoked by the runtime during startup.
      
      We can now drop the "simple" trace backend's g_thread_init() call since
      thread_init() already called it.
      
      Note that we must keep coroutine-gthread.c's g_thread_init() call which
      is located in a constructor function.  There is no guarantee for
      constructor function ordering so thread_init() may only be called later.
      Reported-by: NMario de Chenno <mario.dechenno@unina2.it>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      ae2990c2
  2. 01 2月, 2014 1 次提交
  3. 18 9月, 2013 1 次提交
  4. 29 4月, 2013 1 次提交
    • P
      win32: add readv/writev emulation · 9adea5f7
      Paolo Bonzini 提交于
      Commit e9d8fbf5 (qemu-file: do not use stdio for qemu_fdopen, 2013-03-27)
      introduced a usage of writev, which mingw32 does not have.  Even though
      qemu_fdopen itself is not used on mingw32, the future-proof solution is
      to add an implementation of it.  This is simple and similar to how we
      emulate sendmsg/recvmsg in util/iov.c.
      
      Some files include osdep.h without qemu-common.h, so move the definition
      of iovec to osdep.h too, and include osdep.h from qemu-common.h
      unconditionally (protection against including files when NEED_CPU_H is
      defined is not needed since the removal of AREG0).
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9adea5f7
  5. 24 4月, 2013 1 次提交
  6. 08 3月, 2013 1 次提交
    • L
      osdep: replace setsockopt by qemu_setsockopt · 4bd1afbd
      Lei Li 提交于
      Fix the compiler warning when cross build qemu-ga
      for windows by using qemu_setsockopt() instead of
      setsockopt().
      
      util/osdep.c: In function 'socket_set_nodelay':
      util/osdep.c:69:5: warning: passing argument 4 of 'setsockopt' from
                         incompatible pointer type [enabled by default]
      In file included from /home/lei/qemu_b/include/sysemu/os-win32.h:30:0,
                       from /home/lei/qemu_b/include/qemu-common.h:46,
                       from util/osdep.c:48:
      /usr/i686-w64-mingw32/sys-root/mingw/include/winsock2.h:990:63: note:
                       expected 'const char *' but argument is of type 'int *'
      Signed-off-by: NLei Li <lilei@linux.vnet.ibm.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      4bd1afbd
  7. 04 3月, 2013 1 次提交
  8. 13 1月, 2013 1 次提交
  9. 19 12月, 2012 2 次提交
  10. 19 11月, 2012 1 次提交
  11. 03 11月, 2012 1 次提交
  12. 30 10月, 2012 1 次提交
  13. 24 10月, 2012 1 次提交
  14. 17 8月, 2012 1 次提交
  15. 15 8月, 2012 2 次提交
  16. 04 8月, 2012 1 次提交
    • P
      vnc: disable VNC password authentication (security type 2) when in FIPS mode · 0f66998f
      Paul Moore 提交于
      FIPS 140-2 requires disabling certain ciphers, including DES, which is used
      by VNC to obscure passwords when they are sent over the network.  The
      solution for FIPS users is to disable the use of VNC password auth when the
      host system is operating in FIPS compliance mode and the user has specified
      '-enable-fips' on the QEMU command line.
      
      This patch causes QEMU to emit a message to stderr when the host system is
      running in FIPS mode and a VNC password was specified on the commend line.
      If the system is not running in FIPS mode, or is running in FIPS mode but
      VNC password authentication was not requested, QEMU operates normally.
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      0f66998f
  17. 20 6月, 2012 1 次提交
  18. 22 12月, 2011 1 次提交
  19. 21 12月, 2011 1 次提交
  20. 16 4月, 2011 1 次提交
  21. 30 10月, 2010 7 次提交
  22. 25 9月, 2010 1 次提交
    • A
      Introduce qemu_madvise() · e78815a5
      Andreas Färber 提交于
      vl.c has a Sun-specific hack to supply a prototype for madvise(),
      but the call site has apparently moved to arch_init.c.
      
      Haiku doesn't implement madvise() in favor of posix_madvise().
      OpenBSD and Solaris 10 don't implement posix_madvise() but madvise().
      MinGW implements neither.
      
      Check for madvise() and posix_madvise() in configure and supply qemu_madvise()
      as wrapper. Prefer madvise() over posix_madvise() due to flag availability.
      Convert all callers to use qemu_madvise() and QEMU_MADV_*.
      
      Note that on Solaris the warning is fixed by moving the madvise() prototype,
      not by qemu_madvise() itself. It helps with porting though, and it simplifies
      most call sites.
      
      v7 -> v8:
      * Some versions of MinGW have no sys/mman.h header. Reported by Blue Swirl.
      
      v6 -> v7:
      * Adopt madvise() rather than posix_madvise() semantics for returning errors.
      * Use EINVAL in place of ENOTSUP.
      
      v5 -> v6:
      * Replace two leftover instances of POSIX_MADV_NORMAL with QEMU_MADV_INVALID.
        Spotted by Blue Swirl.
      
      v4 -> v5:
      * Introduce QEMU_MADV_INVALID, suggested by Alexander Graf.
        Note that this relies on -1 not being a valid advice value.
      
      v3 -> v4:
      * Eliminate #ifdefs at qemu_advise() call sites. Requested by Blue Swirl.
        This will currently break the check in kvm-all.c by calling madvise() with
        a supported flag, which will not fail. Ideas/patches welcome.
      
      v2 -> v3:
      * Reuse the *_MADV_* defines for QEMU_MADV_*. Suggested by Alexander Graf.
      * Add configure check for madvise(), too.
        Add defines to Makefile, not QEMU_CFLAGS.
        Convert all callers, untested. Suggested by Blue Swirl.
      * Keep Solaris' madvise() prototype around. Pointed out by Alexander Graf.
      * Display configure check results.
      
      v1 -> v2:
      * Don't rely on posix_madvise() availability, add qemu_madvise().
        Suggested by Blue Swirl.
      Signed-off-by: NAndreas Färber <afaerber@opensolaris.org>
      Cc: Blue Swirl <blauwirbel@gmail.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      e78815a5
  23. 10 9月, 2010 1 次提交
  24. 28 6月, 2010 1 次提交
    • S
      win32: Add missing function ffs · 4972d592
      Stefan Weil 提交于
      mingw32 does not include function ffs.
      
      Commit c6d29ad6 added a
      declaration for ffs, but an implementation was missing.
      
      For compilations with optimization, the compiler creates
      inline code, so the implementation is not always needed.
      
      Without optimization, linking fails without this patch.
      
      v2: Use __builtin_ffs as suggested by Richard Henderson
      
      Cc: Richard Henderson <rth@twiddle.net>
      Signed-off-by: NStefan Weil <weil@mail.berlios.de>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      4972d592
  25. 10 3月, 2010 1 次提交
  26. 24 2月, 2010 1 次提交
  27. 17 2月, 2010 1 次提交
  28. 11 2月, 2010 1 次提交
  29. 27 1月, 2010 2 次提交
  30. 14 1月, 2010 1 次提交
  31. 19 12月, 2009 1 次提交