From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1tpw-00068M-Do for qemu-devel@nongnu.org; Fri, 19 Dec 2014 04:27:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1tpq-0002S1-95 for qemu-devel@nongnu.org; Fri, 19 Dec 2014 04:27:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1tpq-0002Rq-0R for qemu-devel@nongnu.org; Fri, 19 Dec 2014 04:26:58 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBJ9Qv2v023706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 19 Dec 2014 04:26:57 -0500 Message-ID: <5493EF5F.1010505@redhat.com> Date: Fri, 19 Dec 2014 10:26:55 +0100 From: Max Reitz MIME-Version: 1.0 References: <1418304053-15140-1-git-send-email-mreitz@redhat.com> <1418304053-15140-3-git-send-email-mreitz@redhat.com> <20141218151952.GE25902@noname.redhat.com> In-Reply-To: <20141218151952.GE25902@noname.redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 02/14] block: Add blk_new_open() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , Markus Armbruster On 2014-12-18 at 16:19, Kevin Wolf wrote: > Am 11.12.2014 um 14:20 hat Max Reitz geschrieben: >> blk_new_with_bs() creates a BlockBackend with an empty BlockDriverState >> attached to it. Empty BDSs are not nice, therefore add an alternative >> function which combines blk_new_with_bs() with bdrv_open(). >> >> Note: In contrast to bdrv_open() which takes a BlockDriver parameter, >> blk_new_open() does not take such a parameter. This is because >> bdrv_open() opens a BlockDriverState, therefore it is naturally to be >> able to set the BlockDriver for that BDS. The fact that bdrv_open() can >> open more than a single BDS is merely some form of a byproduct. >> >> blk_new_open() on the other hand is intended to be used to create a >> whole tree of BlockDriverStates. Therefore, setting a single BlockDriver >> does not make much sense. Instead, the drivers to be used for each of >> the nodes must be configured through the "options" QDict; including the >> driver of the root BDS. > This is an interesting point. I generally agree with your reasoning, but > if we did things right, the same would apply to filename and flags as > well. But we don't, so we can't remove them now. > > I'm actually surprised that leaving out the driver option seem to work > well enough. Well, just putting the filename into the QDict won't work thanks to the additional parsing that is done on the non-QDict filename; and most flags don't have any correspondence in the QDict. On the other hand, putting the driver name into the QDict is easy enough and will do exactly the same as specifying the BlockDriver directly, except for some different error messages. > Should at least a TODO be left here for removing filename and flags? Yes, will do. Max