[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v3 01/16] block: Introduce BDS.file_child
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PATCH v3 01/16] block: Introduce BDS.file_child |
Date: |
Fri, 9 Oct 2015 14:15:26 +0200 |
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: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
---
block.c | 12 +++++++++---
include/block/block_int.h | 1 +
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/block.c b/block.c
index 1f90b47..75afed1 100644
--- a/block.c
+++ b/block.c
@@ -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 */
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 14ad4c3..d0dd93e 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -381,6 +381,7 @@ struct BlockDriverState {
BlockDriverState *backing_hd;
BdrvChild *backing_child;
BlockDriverState *file;
+ BdrvChild *file_child;
NotifierList close_notifiers;
--
1.8.3.1
- [Qemu-block] [PATCH v3 05/16] block: Convert bs->file to BdrvChild, (continued)
- [Qemu-block] [PATCH v3 10/16] block/io: Make bdrv_requests_pending() public, Kevin Wolf, 2015/10/09
- [Qemu-block] [PATCH v3 11/16] block-backend: Add blk_set_bs(), Kevin Wolf, 2015/10/09
- [Qemu-block] [PATCH v3 14/16] blockjob: Store device name at job creation, Kevin Wolf, 2015/10/09
- [Qemu-block] [PATCH v3 01/16] block: Introduce BDS.file_child,
Kevin Wolf <=
- [Qemu-block] [PATCH v3 06/16] block: Remove bdrv_open_image(), Kevin Wolf, 2015/10/09
- [Qemu-block] [PATCH v3 02/16] vmdk: Use BdrvChild instead of BDS for references to extents, Kevin Wolf, 2015/10/09
- [Qemu-block] [PATCH v3 09/16] block: Split bdrv_move_feature_fields(), Kevin Wolf, 2015/10/09
- [Qemu-block] [PATCH v3 04/16] quorum: Convert to BdrvChild, Kevin Wolf, 2015/10/09
- [Qemu-block] [PATCH v3 07/16] block: Convert bs->backing_hd to BdrvChild, Kevin Wolf, 2015/10/09