From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WstrJ-0003ud-Ik for qemu-devel@nongnu.org; Fri, 06 Jun 2014 09:07:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WstrA-0003YF-EF for qemu-devel@nongnu.org; Fri, 06 Jun 2014 09:07:01 -0400 Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]:64764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WstrA-0003Y5-4I for qemu-devel@nongnu.org; Fri, 06 Jun 2014 09:06:52 -0400 Received: by mail-we0-f178.google.com with SMTP id p10so761160wes.9 for ; Fri, 06 Jun 2014 06:06:51 -0700 (PDT) Date: Fri, 6 Jun 2014 15:06:47 +0200 From: Stefan Hajnoczi Message-ID: <20140606130647.GC14322@stefanha-thinkpad> References: <1402019610-2985-1-git-send-email-famz@redhat.com> <1402019610-2985-3-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1402019610-2985-3-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 2/9] virtio-blk: Convert VirtIOBlockReq.elem to pointer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi On Fri, Jun 06, 2014 at 09:53:23AM +0800, Fam Zheng wrote: > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c > index 49507ac..388741e 100644 > --- a/hw/block/virtio-blk.c > +++ b/hw/block/virtio-blk.c > @@ -27,6 +27,22 @@ > #endif > #include "hw/virtio/virtio-bus.h" > > +static VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s) > +{ > + VirtIOBlockReq *req = g_malloc0(sizeof(*req)); The virtio-blk.c code used g_malloc() but since we're using g_slice_new0() for the VirtQueueElement, we might as well use the slice allocator here too.