diff options
author | Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> | 2011-12-21 12:37:22 +0530 |
---|---|---|
committer | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-12-21 12:37:22 +0530 |
commit | 302a0d3ed721e4c30c6a2a37f64c60b50ffd33b9 (patch) | |
tree | d8b168af72641484a578bb2b16be4e2c0fb5273f /fsdev/file-op-9p.h | |
parent | 3799ce4ab64f578eb818689a276e4f0c73d01fb5 (diff) |
hw/9pfs: replace iovec manipulation with QEMUIOVector
The v9fs_read() and v9fs_write() functions rely on iovec[] manipulation
code should be replaced with QEMUIOVector to avoid duplicating code.
In the future it may be possible to make the code even more concise by
using QEMUIOVector consistently across virtio and 9pfs.
The "v" format specifier for pdu_marshal() and pdu_unmarshal() is
dropped since it does not actually pack/unpack anything. The specifier
was also not implemented to update the offset variable and could only be
used at the end of a format string, another sign that this shouldn't
really be a format specifier. Instead, see the new
v9fs_init_qiov_from_pdu() function.
This change avoids a possible iovec[] buffer overflow when indirect
vrings are used since the number of vectors is now limited by the
underlying VirtQueueElement and cannot be out-of-bounds.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'fsdev/file-op-9p.h')
0 files changed, 0 insertions, 0 deletions