1. 10 5月, 2014 1 次提交
    • S
      glib: fix g_poll early timeout on windows · 5a007547
      Sangho Park 提交于
      g_poll has a problem on Windows when using
      timeouts < 10ms, in glib/gpoll.c:
      
      /* If not, and we have a significant timeout, poll again with
       * timeout then. Note that this will return indication for only
       * one event, or only for messages. We ignore timeouts less than
       * ten milliseconds as they are mostly pointless on Windows, the
       * MsgWaitForMultipleObjectsEx() call will timeout right away
       * anyway.
       */
      if (retval == 0 && (timeout == INFINITE || timeout >= 10))
        retval = poll_rest (poll_msgs, handles, nhandles, fds, nfds, timeout);
      
      so whenever g_poll is called with timeout < 10ms it does
      a quick poll instead of wait, this causes significant performance
      degradation of QEMU, thus we should use WaitForMultipleObjectsEx
      directly
      Signed-off-by: NStanislav Vorobiov <s.vorobiov@samsung.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      5a007547
  2. 20 2月, 2014 1 次提交
  3. 22 1月, 2014 1 次提交
  4. 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
  5. 13 9月, 2013 1 次提交
  6. 31 5月, 2013 1 次提交
  7. 14 5月, 2013 2 次提交
  8. 02 4月, 2013 1 次提交
  9. 15 1月, 2013 1 次提交
  10. 13 1月, 2013 1 次提交
  11. 19 12月, 2012 2 次提交
  12. 19 11月, 2012 1 次提交
  13. 03 11月, 2012 1 次提交
  14. 30 10月, 2012 1 次提交
  15. 24 9月, 2012 1 次提交
    • S
      w32: Add implementation of gmtime_r, localtime_r · d3e8f957
      Stefan Weil 提交于
      Those functions are missing in MinGW.
      
      Some versions of MinGW-w64 include defines for gmtime_r and localtime_r.
      Older versions of these macros are buggy (they return a pointer to a
      static variable), therefore we don't want them. Newer versions are
      similar to the code used here, but without the memset.
      
      The implementation which is used here is not strictly reentrant,
      but sufficiently good for QEMU on w32 or w64.
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      [blauwirbel@gmail.com: added comment about locking]
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      d3e8f957
  16. 07 4月, 2012 1 次提交
    • P
      main-loop: interrupt wait when data arrives on a socket · d3385eb4
      Paolo Bonzini 提交于
      Right now, the main loop is not interrupted when data arrives on a
      socket.  To fix this, register each socket to interrupt the main loop
      with WSAEventSelect.  This does not replace select, it only communicates
      a change in socket state that requires a select call.
      
      Since the interrupt fires only once per recv call, or only once
      after a send call returns EWOULDBLOCK we can activate it on all events
      unconditionally.  If QEMU is momentarily uninterested on some condition,
      the main loop will not busy wait.  Instead, it may get one extra wakeup,
      but then it will ignore the condition until progress occurs and/or
      qemu_set_fd_handler is called to set a callback.  At this point the
      condition will be tested via select and the callback will be invoked
      even if it is still disabled on the event.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      d3385eb4
  17. 22 12月, 2011 1 次提交
  18. 21 10月, 2011 1 次提交
  19. 21 2月, 2011 1 次提交
  20. 30 10月, 2010 4 次提交
  21. 10 9月, 2010 1 次提交
  22. 15 6月, 2010 1 次提交
    • C
      cow: stop using mmap · 893a9cb4
      Christoph Hellwig 提交于
      We don't have an equivalent to mmap in the qemu block API, so read and
      write the bitmap directly.  At least in the dumb implementation added
      in this patch this is a lot less efficient, but it means cow can also
      work on windows, and over nbd or curl.  And it fixes qemu-iotests testcase
      012 which did not work properly due to issues with read-only mmap access.
      
      In addition we can also get rid of the now unused get_mmap_addr function.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      893a9cb4
  23. 29 5月, 2010 1 次提交
  24. 24 2月, 2010 1 次提交
  25. 12 12月, 2009 1 次提交
    • A
      Do not abort on qemu_malloc(0) in production builds · 20ff6c80
      Anthony Liguori 提交于
      qemu_malloc() does not allow size=0 to be passed in and aborts on this behavior.
      
      Unfortunately, there is good reason to believe that within qemu, there are a
      number of, so far, undetected places that assume size=0 can be safely passed.
      Since we do not want to abort unnecessarily in production builds, return
      qemu_malloc(1) whenever the version file indicates that this is a production
      build.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      20ff6c80
  26. 20 5月, 2009 2 次提交
  27. 12 2月, 2009 1 次提交
  28. 06 2月, 2009 2 次提交
  29. 09 11月, 2008 1 次提交
  30. 26 8月, 2008 1 次提交
  31. 22 8月, 2008 1 次提交
  32. 06 8月, 2008 1 次提交
  33. 09 6月, 2008 1 次提交