aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi/virtio-scsi.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-09-16 15:20:17 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2014-09-23 15:40:51 +0200
commit61e68b3fbd3e2b7beb636bc56f78d9c1ca25e8f9 (patch)
tree94312f417d4022a681392b1526c590a18924ceb2 /hw/scsi/virtio-scsi.c
parent380f649e02f9545159dc3158d7c1b2e70c1005e3 (diff)
scsi: Optimize scsi_req_alloc
Zeroing sense buffer for each scsi request is not efficient, we can just leave it uninitialized because sense_len is set to 0. Move the implicitly zeroed fields to the end of the structure and use a partial memset. The explicitly initialized fields (by scsi_req_alloc or scsi_req_new) are moved to the beginning of the structure, before sense buffer, to skip the memset. Also change g_malloc0 to g_slice_alloc. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/virtio-scsi.c')
0 files changed, 0 insertions, 0 deletions