From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] scsi: Optimize scsi_req_alloc
Date: Thu, 11 Sep 2014 12:52:52 +0200 [thread overview]
Message-ID: <54117F04.4060501@redhat.com> (raw)
In-Reply-To: <1410430599-27540-2-git-send-email-famz@redhat.com>
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
next prev parent reply other threads:[~2014-09-11 10:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 10:16 [Qemu-devel] [PATCH 0/2] virtio-scsi: Optimizing request allocation Fam Zheng
2014-09-11 10:16 ` [Qemu-devel] [PATCH 1/2] scsi: Optimize scsi_req_alloc Fam Zheng
2014-09-11 10:52 ` Paolo Bonzini [this message]
2014-09-11 10:16 ` [Qemu-devel] [PATCH 2/2] virtio-scsi: Optimize virtio_scsi_init_req Fam Zheng
2014-09-11 10:55 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54117F04.4060501@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.