From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFDDV-0003Ag-GE for qemu-devel@nongnu.org; Mon, 30 Nov 2009 15:51:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFDDP-0002zc-DK for qemu-devel@nongnu.org; Mon, 30 Nov 2009 15:51:27 -0500 Received: from [199.232.76.173] (port=59290 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFDDP-0002zG-6R for qemu-devel@nongnu.org; Mon, 30 Nov 2009 15:51:23 -0500 Received: from verein.lst.de ([213.95.11.210]:37333) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1NFDDO-0002L9-Ce for qemu-devel@nongnu.org; Mon, 30 Nov 2009 15:51:22 -0500 Date: Mon, 30 Nov 2009 21:51:20 +0100 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH] raw: Use the right host device driver for open/create Message-ID: <20091130205120.GA6053@lst.de> References: <1259596471-14576-1-git-send-email-kwolf@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1259596471-14576-1-git-send-email-kwolf@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org On Mon, Nov 30, 2009 at 04:54:31PM +0100, Kevin Wolf wrote: > Users don't expect that they need to specify host_device/cdrom/floppy when > "creating" an image on a block device or converting with an device as target. > Currently creating as raw leads to 'Error while formatting' whereas using as > raw just works. > > With this patch raw is accepted for both files and host devices. For devices > the block driver is transparently changed to host_*. I agree that we should allow raw to also cover host devices, but I don't like the implementation very much. Beeing used to specify the format is pretty much the only reason to have the name in the block driver anyway, and looking it up in one is a bit of a layering violation. I'd suggest to either allow multiple formats with the same name and looping over them or some sort of alias property in the block driver to also match the alias instead.