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 <kw...@redhat.com>
---
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.
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).
So:
Reviewed-by: Max Reitz <mre...@redhat.com>