- 30 10月, 2012 2 次提交
-
-
由 Paolo Bonzini 提交于
This removes the dependency of cutils.c on iov.c, and lets us remove iov.o from several builds. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Michael S. Tsirkin 提交于
Add API to copy part of iovec safely. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 28 9月, 2012 1 次提交
-
-
由 Michael S. Tsirkin 提交于
iov_from_buf does not change iov, make it const. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 15 8月, 2012 1 次提交
-
-
由 Peter Maydell 提交于
POSIX allows sendmsg() and recvmsg() to fail EMSGSIZE if passed a zero msg.msg_iovlen (in particular the MacOS X implementation will do this). Handle the case where iov_send_recv() is passed a zero byte count explicitly, to avoid accidentally depending on the OS to treat zero msg_iovlen as a no-op. Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Acked-by: NMichael Tokarev <mjt@tls.msk.ru> Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
- 11 7月, 2012 1 次提交
-
-
由 Stefan Weil 提交于
Commit 25e5e4c7 broke compilation for non POSIX hosts (e.g. MinGW) because it partially replaced "ret" by "count". It also changed the handling of EINTR in a wrong way. The patch restores the old code for these two changes. Signed-off-by: NStefan Weil <sw@weilnetz.de> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 12 6月, 2012 1 次提交
-
-
由 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>
-
- 08 6月, 2012 2 次提交
-
-
由 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>
-
由 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>
-
- 14 1月, 2012 1 次提交
-
-
由 Paolo Bonzini 提交于
All files under GPLv2 will get GPLv2+ changes starting tomorrow. event_notifier.c and exec-obsolete.h were only ever touched by Red Hat employees and can be relicensed now. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 04 8月, 2011 2 次提交
-
-
由 Gerd Hoffmann 提交于
Fill the spefified area with zeros. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
Useful for debugging purposes. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 18 7月, 2011 1 次提交
-
-
由 Hannes Reinecke 提交于
iov_to_buf() has an 'offset' parameter, iov_from_buf() hasn't. This patch adds the missing parameter to iov_from_buf(). It also renames the 'offset' parameter to 'iov_off' to emphasize it's the offset into the iovec and not the buffer. Signed-off-by: NHannes Reinecke <hare@suse.de> Acked-by: NAlexander Graf <agraf@suse.de> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 11 5月, 2010 1 次提交
-
-
由 Amit Shah 提交于
The iov functions can be useful to other code as well. Signed-off-by: NAmit Shah <amit.shah@redhat.com> CC: Christoph Hellwig <hch@lst.de> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 28 4月, 2010 2 次提交
-
-
由 Amit Shah 提交于
iov_to_buf() puts the buffer contents in the iov in a linearized buffer. iov_size() gets the length of the contents in the iov. The iov_to_buf() function is the memcpy_to_iovec() function that was used in virtio-ballon.c. Signed-off-by: NAmit Shah <amit.shah@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Amit Shah 提交于
The virtio-net code uses iov_fill() which fills an iov from a linear buffer. The virtio-serial-bus code does something similar in an open-coded function. Create a new iov.c file that has iov_from_buf(). Convert virtio-net and virtio-serial-bus over to use this functionality. virtio-net used ints to hold sizes, the new function is going to use size_t types. Later commits will add the opposite functionality -- going from an iov to a linear buffer. Signed-off-by: NAmit Shah <amit.shah@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-