From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34608 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODdr3-0002Sb-Pk for qemu-devel@nongnu.org; Sun, 16 May 2010 09:26:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODdr0-0002Yy-QX for qemu-devel@nongnu.org; Sun, 16 May 2010 09:26:05 -0400 Received: from verein.lst.de ([213.95.11.210]:39795) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODdr0-0002Yo-Gv for qemu-devel@nongnu.org; Sun, 16 May 2010 09:26:02 -0400 Date: Sun, 16 May 2010 15:25:57 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH] virtio-blk: Avoid zeroing every request structure Message-ID: <20100516132557.GB26872@lst.de> References: <1273873950-25756-1-git-send-email-stefanha@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1273873950-25756-1-git-send-email-stefanha@linux.vnet.ibm.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org On Fri, May 14, 2010 at 10:52:30PM +0100, Stefan Hajnoczi wrote: > diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c > index b05d15e..d270225 100644 > --- a/hw/virtio-blk.c > +++ b/hw/virtio-blk.c > @@ -105,8 +105,10 @@ static void virtio_blk_flush_complete(void *opaque, int ret) > > static VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s) > { > - VirtIOBlockReq *req = qemu_mallocz(sizeof(*req)); > + VirtIOBlockReq *req = qemu_malloc(sizeof(*req)); > req->dev = s; > + req->qiov.size = 0; > + req->next = NULL; > return req; Looks good, but you shouldn't even need to initialize req->qiov.size, we do this later by calling qemu_iovec_init_external before using it.