From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VodlW-00047D-Jt for qemu-devel@nongnu.org; Thu, 05 Dec 2013 13:35:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VodlQ-0000aA-LL for qemu-devel@nongnu.org; Thu, 05 Dec 2013 13:35:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VodlQ-0000Xo-Dm for qemu-devel@nongnu.org; Thu, 05 Dec 2013 13:35:04 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB5IZ3Bx008068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 5 Dec 2013 13:35:03 -0500 Message-ID: <52A0C77F.8060200@redhat.com> Date: Thu, 05 Dec 2013 19:35:43 +0100 From: Max Reitz MIME-Version: 1.0 References: <52A0BAD8.90001@redhat.com> In-Reply-To: <52A0BAD8.90001@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC] Using BlockdevRef in the block layer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" Cc: Kevin Wolf , Stefan Hajnoczi On 05.12.2013 18:41, Max Reitz wrote: > [=85] > > Second, if specifying a reference to an existing device should really=20 > be supported, bdrv_open() should ideally not call bdrv_file_open()=20 > anymore, but a function bdrv_find_ref() instead which resolves a=20 > BlockdevRef structure (for simplicity, it appears to be easier to use=20 > a QDict equivalent to a BlockdevRef instead of the latter itself=20 > (since that results in many effectively redundant conversions to and=20 > from those representations)). However, bdrv_file_open() supports=20 > parsing protocol filenames, which bdrv_find_ref() would not. As a=20 > result, it is probably best to call bdrv_find_ref() from=20 > bdrv_file_open() instead and leave bdrv_open() generally the way it is=20 > right now =96 yes, this is a question. ;-) (=93Do you agree?=94) I noticed only just now that the current design does not seem to allow=20 nesting of files (i.e., driver=3Dblkdebug-qmp, file.driver=3Dqcow2,=20 file.file.driver=3Dfile). Perhaps I do have to call bdrv_find_ref() in=20 bdrv_open() and only resort to bdrv_file_open() if a filename that must=20 be parsed was given...? Max