Received: from eggs.gnu.org ([2001:4830:134:3::10]:34861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsTqj-0001xz-GN for qemu-devel@nongnu.org; Thu, 05 Jun 2014 05:20:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsTqZ-0007i8-H2 for qemu-devel@nongnu.org; Thu, 05 Jun 2014 05:20:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsTqY-0007hY-Sc for qemu-devel@nongnu.org; Thu, 05 Jun 2014 05:20:31 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s559KTEO014990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 5 Jun 2014 05:20:29 -0400 Date: Thu, 5 Jun 2014 17:20:42 +0800 From: Fam Zheng Message-ID: <20140605092042.GE10963@T430.nay.redhat.com> References: <1401933526-22436-1-git-send-email-famz@redhat.com> <1401933526-22436-9-git-send-email-famz@redhat.com> <538FDC26.4030402@redhat.com> <20140605035042.GC10963@T430.nay.redhat.com> <538FED7C.3070000@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <538FED7C.3070000@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 8/8] virtio-blk: Fill in VirtIOBlockReq.out in dataplane code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On Thu, 06/05 06:09, Paolo Bonzini wrote: > Il 05/06/2014 05:50, Fam Zheng ha scritto: > >>> Can you try moving the req allocation and assignments inside process_request > >>> instead? Then you can fill in req->out directly without the struct > >>> assignment. > >>> > >The owners of req are do_rdwr_cmd and do_flush_cmd, but do_scsi_cmd and > >do_get_id_cmd don't need to allocate. > > They don't need it, but using req there and freeing it in > complete_request_early perhaps could simplify the code. > > After all, the first three arguments of complete_request_early (s, elem, > inhdr) are a duplicate of VirtIOBlockReq and do_flush_cmd is already doing a > free after complete_request_early. > Yes. Although It's not really "early" complete from do_flush_cmd, it's actually a cb complete. But the point makes sense for me. I'll do it. Fam