提交 1fdd6933 编写于 作者: K Kevin Wolf

block: Introduce BDS.file_child

Store the BdrvChild for bs->file. At this point, bs->file_child->bs just
duplicates the bs->file pointer. Later, it will completely replace it.
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
Reviewed-by: NMax Reitz <mreitz@redhat.com>
Reviewed-by: NAlberto Garcia <berto@igalia.com>
Reviewed-by: NFam Zheng <famz@redhat.com>
Reviewed-by: NJeff Cody <jcody@redhat.com>
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 68e517a8
......@@ -1487,11 +1487,17 @@ static int bdrv_open_inherit(BlockDriverState **pbs, const char *filename,
assert(file == NULL);
bs->open_flags = flags;
ret = bdrv_open_image(&file, filename, options, "file",
bs, &child_file, true, &local_err);
if (ret < 0) {
bs->file_child = bdrv_open_child(filename, options, "file", bs,
&child_file, true, &local_err);
if (local_err) {
ret = -EINVAL;
goto fail;
}
if (bs->file_child) {
file = bs->file_child->bs;
}
}
/* Image format probing */
......
......@@ -381,6 +381,7 @@ struct BlockDriverState {
BlockDriverState *backing_hd;
BdrvChild *backing_child;
BlockDriverState *file;
BdrvChild *file_child;
NotifierList close_notifiers;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册