From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1kja-000892-4v for qemu-devel@nongnu.org; Tue, 13 Apr 2010 14:21:14 -0400 Received: from [140.186.70.92] (port=39279 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1kjV-00088Z-6h for qemu-devel@nongnu.org; Tue, 13 Apr 2010 14:21:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1kj6-0004B4-Dp for qemu-devel@nongnu.org; Tue, 13 Apr 2010 14:20:45 -0400 Received: from verein.lst.de ([213.95.11.210]:52814) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1kj4-0004AI-VV for qemu-devel@nongnu.org; Tue, 13 Apr 2010 14:20:43 -0400 Date: Tue, 13 Apr 2010 20:20:33 +0200 From: Christoph Hellwig Message-ID: <20100413182033.GA6756@lst.de> References: <1271083756-31269-1-git-send-email-kwolf@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1271083756-31269-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] Re: [PATCH] block: Split bdrv_open List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, hch@lst.de On Mon, Apr 12, 2010 at 04:49:16PM +0200, Kevin Wolf wrote: > bdrv_open contains quite some code that is only useful for opening images (as > opposed to opening files by a protocol), for example snapshots. > > This patch splits the code so that we have bdrv_open_file() for files (uses > protocols), bdrv_open() for images (uses format drivers) and bdrv_do_open() for > the code common for opening both images and files. > > Signed-off-by: Kevin Wolf > --- > This patch applies on top of Christoph's RFC for the format/protocol split I like this a lot. A few comments: - why is bdrv_do_open below it's users in the code? I really hate forward declarations of functions and they can usually be easily avoided. - a "do" a function name is not very meaningfull - what about bdrv_open_common instead? - doesn't the backing device handling only apply to image formats, too?