From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NANLf-0006W8-7d for qemu-devel@nongnu.org; Tue, 17 Nov 2009 07:39:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NANLZ-0006PZ-IS for qemu-devel@nongnu.org; Tue, 17 Nov 2009 07:39:54 -0500 Received: from [199.232.76.173] (port=57331 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NANLZ-0006Ox-48 for qemu-devel@nongnu.org; Tue, 17 Nov 2009 07:39:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52038) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NANLY-0003m6-KC for qemu-devel@nongnu.org; Tue, 17 Nov 2009 07:39:48 -0500 Message-ID: <4B02998A.5000409@redhat.com> Date: Tue, 17 Nov 2009 13:39:38 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 03/15] scsi: move request lists to QTAILQ. References: <1258453071-3496-1-git-send-email-kraxel@redhat.com> <1258453071-3496-4-git-send-email-kraxel@redhat.com> <200911171159.54656.paul@codesourcery.com> In-Reply-To: <200911171159.54656.paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org On 11/17/09 12:59, Paul Brook wrote: > On Tuesday 17 November 2009, Gerd Hoffmann wrote: >> Changes: >> * Move from open-coded lists to QTAILQ macros. >> * Move the struct elements to the common data structures >> (SCSIDevice + SCSIRequest). >> * Fix request cleanup in the destroy callback. > > This feels like the abstraction boundaries wrong. If the request chain fields > are in common structures then I'd also expect the allocation and linking code > to be common. Isn't that easy because scsi-disk and scsi-generic keep a pool of unused request structures. I didn't change that for now, although I've considered dropping it. Not sure how important it is these days, malloc implementations don't do slow+stupid list walks any more ... When the pools are gone we can easily move scsi_remove_request() to common code and have the common scsi_req_init() function handle allocation and linking too (and probably name it 'alloc' or 'get'). cheers, Gerd