Hi, > Done, thanks for the correction. Do you have a lightweight test vector > that exercises this? The iovec stuff in my areas is all limited to > single iovec element. Interdiff below.
hw/usb/dev-network.c (with TRAFFC_DEBUG) calls this on usb packets which could trigger this in theory. Depends on how the guest allocates the usb packet buffers though, so I'm not fully sure whenever that actually triggers in practice. > @@ -202,11 +202,16 @@ void iov_hexdump(const struct iovec *iov, const > unsigned int iov_cnt, > FILE *fp, const char *prefix, size_t limit) > { > int v; > - for (v = 0; v < iov_cnt && limit; v++) { > - int size = limit < iov[v].iov_len ? limit : iov[v].iov_len; > - hexdump(iov[v].iov_base, fp, prefix, size); > - limit -= size; > + size_t size = 0; > + char *buf; > + > + for (v = 0; v < iov_cnt; v++) { > + size += iov[v].iov_len; > } > + size = size > limit ? limit : size; > + buf = g_malloc(size); > + iov_to_buf(iov, iov_cnt, 0, buf, size); You've lost the actual hexdump() call here ;) > + g_free(buf); Otherwise it looks fine. cheers, Gerd