1. 20 10月, 2015 1 次提交
    • D
      osdep: add qemu_fork() wrapper for safely handling signals · 57cb38b3
      Daniel P. Berrange 提交于
      When using regular fork() the child process of course inherits
      all the parents' signal handlers. If the child then proceeds
      to close() any open file descriptors, it may break some of those
      registered signal handlers. The child generally does not want to
      ever run any of the signal handlers that the parent may have
      installed in the short time before it exec's. The parent may also
      have blocked various signals which the child process will want
      enabled.
      
      This introduces a wrapper qemu_fork() that takes care to sanitize
      signal handling across fork. Before forking it blocks all signals
      in the parent thread. After fork returns, the parent unblocks the
      signals and carries on as usual. The child, however, resets all the
      signal handlers back to their defaults before it unblocks signals.
      The child process can now exec the binary in a "clean" signal
      environment.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      57cb38b3
  2. 01 10月, 2015 2 次提交
  3. 22 5月, 2015 2 次提交
  4. 10 3月, 2015 1 次提交
  5. 23 11月, 2014 1 次提交
  6. 02 11月, 2014 1 次提交
  7. 15 8月, 2014 1 次提交
  8. 10 7月, 2014 1 次提交
  9. 19 6月, 2014 1 次提交
  10. 13 3月, 2014 1 次提交
  11. 20 2月, 2014 1 次提交
  12. 25 1月, 2014 1 次提交
  13. 22 1月, 2014 1 次提交
  14. 03 10月, 2013 1 次提交
    • S
      util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR · 606600a1
      Sebastian Ottlik 提交于
      If a socket is closed it remains in TIME_WAIT state for some time. On operating
      systems using BSD sockets the endpoint of the socket may not be reused while in
      this state unless SO_REUSEADDR was set on the socket. On windows on the other
      hand the default behaviour is to allow reuse (i.e. identical to SO_REUSEADDR on
      other operating systems) and setting SO_REUSEADDR on a socket allows it to be
      bound to a endpoint even if the endpoint is already used by another socket
      independently of the other sockets state. This can even result in undefined
      behaviour.
      
      Many sockets used by QEMU should not block the use of their endpoint after being
      closed while they are still in TIME_WAIT state. Currently QEMU sets SO_REUSEADDR
      for such sockets, which can lead to problems on Windows. This patch introduces
      the function socket_set_fast_reuse that should be used instead of setting
      SO_REUSEADDR when fast socket reuse is desired and behaves correctly on all
      operating systems.
      
      As a failure of this function can only be caused by bad QEMU internal errors, an
      assertion handles these situations. The return value is still passed on, to
      minimize changes in client code and prevent unused variable warnings if NDEBUG
      is defined.
      Signed-off-by: NSebastian Ottlik <ottlik@fzi.de>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      606600a1
  15. 13 9月, 2013 1 次提交
  16. 31 5月, 2013 1 次提交
  17. 14 5月, 2013 2 次提交
  18. 17 4月, 2013 1 次提交
    • P
      migration: initialize RAM to zero · 7dda5dc8
      Paolo Bonzini 提交于
      Using qemu_memalign only leaves the RAM zero by chance, because libc
      will usually use mmap to satisfy our huge requests.  But memory will
      not be zero when using MALLOC_PERTURB_ with a nonzero value.  In the
      case of incoming migration, this breaks a recently-introduced
      invariant (commit f1c72795, migration: do not sent zero pages in
      bulk stage, 2013-03-26).
      
      To fix this, use mmap ourselves to get a well-aligned, always zero
      block for the RAM.  Mmap-ed memory is easy to "trim" at the sides.
      
      This also removes the need to do something special on valgrind
      (see commit c2a8238a, Support running QEMU on Valgrind, 2011-10-31),
      thus effectively reverts that patch.
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-id: 1365522223-20153-1-git-send-email-pbonzini@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      7dda5dc8
  19. 02 4月, 2013 1 次提交
  20. 05 3月, 2013 1 次提交
  21. 26 1月, 2013 1 次提交
  22. 13 1月, 2013 1 次提交
  23. 19 12月, 2012 2 次提交
  24. 30 10月, 2012 1 次提交
  25. 11 7月, 2012 1 次提交
  26. 29 6月, 2012 1 次提交
  27. 22 12月, 2011 1 次提交
  28. 29 11月, 2011 1 次提交
  29. 01 11月, 2011 1 次提交
    • S
      Support running QEMU on Valgrind · c2a8238a
      Stefan Weil 提交于
      Valgrind is a tool which can automatically detect many kinds of bugs.
      
      Running QEMU on Valgrind with x86_64 hosts was not possible because
      Valgrind aborts when memalign is called with an alignment larger than
      1 MiB. QEMU normally uses 2 MiB on Linux x86_64.
      
      Now the alignment is reduced to the page size when QEMU is running on
      Valgrind.
      
      v2:
      Instead of using the macro RUNNING_ON_VALGRIND from valgrind.h,
      the patch now uses a hack from libvirt which tests for the pre-loaded
      vgpreload_*.so shared libraries. This avoids the need for valgrind.h.
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      c2a8238a
  30. 21 10月, 2011 1 次提交
  31. 10 9月, 2011 1 次提交
  32. 29 7月, 2011 1 次提交
  33. 14 6月, 2011 1 次提交
  34. 03 12月, 2010 1 次提交
    • H
      virtio-9p: fix build on !CONFIG_UTIMENSAT · 38671423
      Hidetoshi Seto 提交于
      This patch introduce a fallback mechanism for old systems that do not
      support utimensat().  This fix build failure with following warnings:
      
      hw/virtio-9p-local.c: In function 'local_utimensat':
      hw/virtio-9p-local.c:479: warning: implicit declaration of function 'utimensat'
      hw/virtio-9p-local.c:479: warning: nested extern declaration of 'utimensat'
      
      and:
      
      hw/virtio-9p.c: In function 'v9fs_setattr_post_chmod':
      hw/virtio-9p.c:1410: error: 'UTIME_NOW' undeclared (first use in this function)
      hw/virtio-9p.c:1410: error: (Each undeclared identifier is reported only once
      hw/virtio-9p.c:1410: error: for each function it appears in.)
      hw/virtio-9p.c:1413: error: 'UTIME_OMIT' undeclared (first use in this function)
      hw/virtio-9p.c: In function 'v9fs_wstat_post_chmod':
      hw/virtio-9p.c:2905: error: 'UTIME_OMIT' undeclared (first use in this function)
      
      [NOTE: At this time virtio-9p is only user of utimensat(), and is available
             only when host is linux and CONFIG_VIRTFS is defined.  So there are
             no similar warning for win32.  Please provide a wrapper for win32 in
             oslib-win32.c if new user really requires it.]
      
      v5:
        - Allow fallback on runtime
        - Move qemu_utimensat() to oslib-posix.c
        - Rebased on latest qemu.git
      v4:
        - Use tv_now.tv_usec
      v3:
        - Use better alternative handling for UTIME_NOW/OMIT
        - Move qemu_utimensat() to cutils.c
      V2:
        - Introduce qemu_utimensat()
      Acked-by: NChris Wright <chrisw@sous-sol.org>
      Acked-by: NM. Mohan Kumar <mohan@in.ibm.com>
      Acked-by: NJes Sorensen <Jes.Sorensen@redhat.com>
      Signed-off-by: NHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
      Signed-off-by: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      38671423
  35. 30 10月, 2010 2 次提交