[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] scsi: Optimize scsi_req_alloc
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] scsi: Optimize scsi_req_alloc |
Date: |
Thu, 11 Sep 2014 12:52:52 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 |
Just a few nits...
Il 11/09/2014 12:16, Fam Zheng ha scritto:
> + uint32_t sense_len;
sense_len is initialized to zero, might as well do that via memset.
> + uint8_t sense[SCSI_SENSE_BUF_SIZE];
> + bool enqueued;
> + bool io_canceled;
> + bool retry;
> + bool dma_started;
> + void *hba_private;
hba_private is always initialized by scsi_req_alloc.
> size_t resid;
> SCSICommand cmd;
resid and cmd are initialized by scsi_req_new (all calls to
scsi_req_alloc happen in scsi_req_new, possibly via scsi_device_alloc_req).
> BlockDriverAIOCB *aiocb;
> QEMUSGList *sg;
> - bool dma_started;
> - uint8_t sense[SCSI_SENSE_BUF_SIZE];
> - uint32_t sense_len;
> - bool enqueued;
> - bool io_canceled;
> - bool retry;
> - void *hba_private;
> QTAILQ_ENTRY(SCSIRequest) next;
Not sure if next needs to be initialized for the QTAILQ functions to
work, but it's definitely safer this way.
Thanks,
Paolo