summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaolo Bonzini2016-01-31 11:29:01 +0100
committerMichael S. Tsirkin2016-02-06 19:44:08 +0100
commit3b3b0628217e2726069990ff9942a5d6d9816bd7 (patch)
tree0e6f5e0f5d38ceb536ccd51bb6092c6d8c1e94a7 /scripts
parentvirtio: introduce virtqueue_alloc_element (diff)
downloadqemu-3b3b0628217e2726069990ff9942a5d6d9816bd7.tar.gz
qemu-3b3b0628217e2726069990ff9942a5d6d9816bd7.tar.xz
qemu-3b3b0628217e2726069990ff9942a5d6d9816bd7.zip
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 'scripts')
0 files changed, 0 insertions, 0 deletions