diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-01-31 11:29:01 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-02-06 20:44:08 +0200 |
commit | 3b3b0628217e2726069990ff9942a5d6d9816bd7 (patch) | |
tree | 0e6f5e0f5d38ceb536ccd51bb6092c6d8c1e94a7 /tests/test-blockjob-txn.c | |
parent | 3724650db07057333879484c8bc7d900b5c1bf8e (diff) |
virtio: slim down allocation of VirtQueueElements
Build the addresses and s/g lists on the stack, and then copy them
to a VirtQueueElement that is just as big as required to contain this
particular s/g list. The cost of the copy is minimal compared to that
of a large malloc.
When virtqueue_map is used on the destination side of migration or on
loadvm, the iovecs have already been split at memory region boundary,
so we can just reuse the out_num/in_num we find in the file.
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tests/test-blockjob-txn.c')
0 files changed, 0 insertions, 0 deletions