diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-22 16:59:20 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-22 16:59:20 +0000 |
commit | 44e3ee8a2aaee5df49cd440446fee4525144255f (patch) | |
tree | 450cf688ca2c46221c9e4447da0bbabde0398b29 /qemu-common.h | |
parent | Add map client retry notification (Avi Kivity) (diff) | |
download | qemu-kvm-44e3ee8a2aaee5df49cd440446fee4525144255f.tar.gz qemu-kvm-44e3ee8a2aaee5df49cd440446fee4525144255f.tar.bz2 qemu-kvm-44e3ee8a2aaee5df49cd440446fee4525144255f.zip |
I/O vector helpers (Avi Kivity)
In general, it is not possible to predict the size of of an I/O vector since
a contiguous guest region may map to a disconiguous host region. Add some
helpers to manage I/O vector growth.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6396 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'qemu-common.h')
-rw-r--r-- | qemu-common.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qemu-common.h b/qemu-common.h index d83e61be3..ae773e05d 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -191,6 +191,18 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id); /* Force QEMU to stop what it's doing and service IO */ void qemu_service_io(void); +typedef struct QEMUIOVector { + struct iovec *iov; + int niov; + int nalloc; +} QEMUIOVector; + +void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint); +void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len); +void qemu_iovec_destroy(QEMUIOVector *qiov); +void qemu_iovec_to_buffer(QEMUIOVector *qiov, void *buf); +void qemu_iovec_from_buffer(QEMUIOVector *qiov, const void *buf); + #endif /* dyngen-exec.h hack */ #endif |