1. 06 8月, 2013 1 次提交
  2. 20 5月, 2013 1 次提交
  3. 18 5月, 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. 17 4月, 2013 4 次提交
  6. 16 3月, 2013 1 次提交
  7. 06 2月, 2013 1 次提交
  8. 13 1月, 2013 1 次提交
  9. 02 1月, 2013 2 次提交
    • S
      iov: add qemu_iovec_concat_iov() · 530c0bbd
      Stefan Hajnoczi 提交于
      The qemu_iovec_concat() function copies a subset of a QEMUIOVector.  The
      new qemu_iovec_concat_iov() function does the same for a iov/cnt pair.
      
      It is easy to define qemu_iovec_concat() in terms of
      qemu_iovec_concat_iov().  The existing code is mostly unchanged, except
      for the assertion src->size >= soffset, which cannot be efficiently
      checked upfront on a iov/cnt pair.  Instead we assert upon hitting the
      end of src with an unsatisfied soffset.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      530c0bbd
    • S
      iov: add iov_discard_front/back() to remove data · d0277635
      Stefan Hajnoczi 提交于
      The iov_discard_front/back() functions remove data from the front or
      back of the vector.  This is useful when peeling off header/footer
      structs.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      d0277635
  10. 19 12月, 2012 1 次提交
  11. 30 10月, 2012 2 次提交
  12. 28 9月, 2012 1 次提交
  13. 15 8月, 2012 1 次提交
  14. 11 7月, 2012 1 次提交
  15. 12 6月, 2012 1 次提交
    • M
      rewrite iov_send_recv() and move it to iov.c · 25e5e4c7
      Michael Tokarev 提交于
      Make it much more understandable, add a missing
      iov_cnt argument (number of iovs in the iov), and
      add comments to it.
      
      The new implementation has been extensively tested
      by splitting a large buffer into many small
      randomly-sized chunks, sending it over socket to
      another, slow process and verifying the receiving
      data is the same.
      
      Also add a unit test for iov_send_recv(), sending/
      receiving data between two processes over a socketpair
      using random vectors and random sizes.
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      25e5e4c7
  16. 08 6月, 2012 2 次提交
    • M
      rewrite iov_* functions · 2278a69e
      Michael Tokarev 提交于
      This changes implementations of all iov_*
      functions, completing the previous step.
      
      All iov_* functions now ensure that this offset
      argument is within the iovec (using assertion),
      but lets to specify `bytes' value larger than
      actual length of the iovec - in this case they
      stops at the actual end of iovec.  It is also
      suggested to use convinient `-1' value as `bytes'
      to mean just this -- "up to the end".
      
      There's one very minor semantic change here: new
      requiriment is that `offset' points to inside of
      iovec.  This is checked just at the end of functions
      (assert()), it does not actually need to be enforced,
      but using any of these functions with offset pointing
      past the end of iovec is wrong anyway.
      
      Note: the new code in iov.c uses arithmetic with
      void pointers.  I thought this is not supported
      everywhere and is a GCC extension (indeed, the C
      standard does not define void arithmetic).  However,
      the original code already use void arith in
      iov_from_buf() function:
        (memcpy(..., buf + buf_off,...)
      which apparently works well so far (it is this
      way in qemu 1.0).  So I left it this way and used
      it in other places.
      
      While at it, add a unit-test file test-iov.c,
      to check various corner cases with iov_from_buf(),
      iov_to_buf() and iov_memset().
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      2278a69e
    • M
      change iov_* function prototypes to be more appropriate · dcf6f5e1
      Michael Tokarev 提交于
      Reorder arguments to be more natural, readable and
      consistent with other iov_* functions, and change
      argument names, from:
       iov_from_buf(iov, iov_cnt, buf, iov_off, size)
      to
       iov_from_buf(iov, iov_cnt, offset, buf, bytes)
      
      The result becomes natural English:
      
       copy data to this `iov' vector with `iov_cnt'
       elements starting at byte offset `offset'
       from memory buffer `buf', processing `bytes'
       bytes max.
      
      (Try to read the original prototype this way).
      
      Also change iov_clear() to more general iov_memset()
      (it uses memset() internally anyway).
      
      While at it, add comments to the header file
      describing what the routines actually does.
      
      The patch only renames argumens in the header, but
      keeps old names in the implementation.  The next
      patch will touch actual code to match.
      
      Now, it might look wrong to pay so much attention
      to so small things.  But we've so many badly designed
      interfaces already so the whole thing becomes rather
      confusing or error prone.  One example of this is
      previous commit and small discussion which emerged
      from it, with an outcome that the utility functions
      like these aren't well-understdandable, leading to
      strange usage cases.  That's why I paid quite some
      attention to this set of functions and a few
      others in subsequent patches.
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      dcf6f5e1
  17. 14 1月, 2012 1 次提交
  18. 04 8月, 2011 2 次提交
  19. 18 7月, 2011 1 次提交
  20. 11 5月, 2010 1 次提交
  21. 28 4月, 2010 2 次提交