scsi-disk: lazily allocate bounce buffer
commit7285477ab11831b1cf56e45878a89170dd06d9b9
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 16 Sep 2011 14:40:04 +0000 (16 16:40 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 20 Sep 2011 10:27:43 +0000 (20 12:27 +0200)
treedf170949e1a3e643970ef085578943fc5a8205e8
parent103b40f51e4012b3b0ad20f615562a1806d7f49a
scsi-disk: lazily allocate bounce buffer

It will not be needed for reads and writes if the HBA provides a sglist.
In addition, this lets scsi-disk refuse commands with an excessive
allocation length, as well as limit memory on usual well-behaved guests.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/scsi-disk.c