qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH for-2.4 2/5] block: Introduce bdrv_open_child()


From: Kevin Wolf
Subject: Re: [Qemu-block] [PATCH for-2.4 2/5] block: Introduce bdrv_open_child()
Date: Fri, 10 Jul 2015 18:39:02 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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 <address@hidden>
> >---
> >  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]