From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDbKR-00077w-U5 for qemu-devel@nongnu.org; Fri, 10 Jul 2015 12:39:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDbKQ-0006Pm-Nm for qemu-devel@nongnu.org; Fri, 10 Jul 2015 12:39:11 -0400 Date: Fri, 10 Jul 2015 18:39:02 +0200 From: Kevin Wolf Message-ID: <20150710163902.GB3870@noname.redhat.com> References: <1436384203-10576-1-git-send-email-kwolf@redhat.com> <1436384203-10576-3-git-send-email-kwolf@redhat.com> <559FE9FE.3040005@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <559FE9FE.3040005@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.4 2/5] block: Introduce bdrv_open_child() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: berto@igalia.com, stefanha@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org Am 10.07.2015 um 17:51 hat Max Reitz geschrieben: > On 08.07.2015 21:36, Kevin Wolf wrote: > >It is the same as bdrv_open_image(), except that it doesn't only return > >success or failure, but the newly created BdrvChild object for the new > >child node. > > > >As the BdrvChild object already contains a BlockDriverState pointer (and > >this is supposed to become the only pointer so that bdrv_append() and > >friends can just change a single pointer in BdrvChild), the pbs > >parameter is removed for bdrv_open_child(). > > > >Signed-off-by: Kevin Wolf > >--- > > block.c | 71 +++++++++++++++++++++++++++++++++++++-------------- > > include/block/block.h | 6 +++++ > > 2 files changed, 58 insertions(+), 19 deletions(-) > > Are you planning on removing bdrv_open_image() later on? Because the > version introduced here behaves differently than the one before this > patch, in that before the error value returned by bdrv_open() was > preserved. Yes. As I wrote in the cover letter, this is just the start of my bdrv_swap series. The current status of it can be seen here: http://repo.or.cz/w/qemu/kevin.git/shortlog/refs/heads/bdrv_swap All callers of bdrv_open_image() are converted to bdrv_open_child() there and bdrv_open_image() is removed eventually. (The -EINVAL stays, however, it's just moved to the callers.) > I don't think this is noticeable at all, though, since as long as > there is an Error object involved, the exact value returned doesn't > really matter (but I can't verify that assumption, since the value > returned by bdrv_open_image() seems to be preserved by a lot of > nested function calls). Right, that's my assumption as well. If .bdrv_open() returns an Error, the exact return code shouldn't matter as long as it's negative. Kevin