[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 52/69] block: Invalidate all children
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 52/69] block: Invalidate all children |
Date: |
Thu, 12 May 2016 16:35:32 +0200 |
From: Fam Zheng <address@hidden>
Currently we only recurse to bs->file, which will miss the children in quorum
and VMDK.
Recurse into the whole subtree to avoid that.
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/block.c b/block.c
index d70ae55..71b523c 100644
--- a/block.c
+++ b/block.c
@@ -3198,6 +3198,7 @@ void bdrv_init_with_whitelist(void)
void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp)
{
+ BdrvChild *child;
Error *local_err = NULL;
int ret;
@@ -3212,13 +3213,20 @@ void bdrv_invalidate_cache(BlockDriverState *bs, Error
**errp)
if (bs->drv->bdrv_invalidate_cache) {
bs->drv->bdrv_invalidate_cache(bs, &local_err);
- } else if (bs->file) {
- bdrv_invalidate_cache(bs->file->bs, &local_err);
+ if (local_err) {
+ bs->open_flags |= BDRV_O_INACTIVE;
+ error_propagate(errp, local_err);
+ return;
+ }
}
- if (local_err) {
- bs->open_flags |= BDRV_O_INACTIVE;
- error_propagate(errp, local_err);
- return;
+
+ QLIST_FOREACH(child, &bs->children, next) {
+ bdrv_invalidate_cache(child->bs, &local_err);
+ if (local_err) {
+ bs->open_flags |= BDRV_O_INACTIVE;
+ error_propagate(errp, local_err);
+ return;
+ }
}
ret = refresh_total_sectors(bs, bs->total_sectors);
--
1.8.3.1
- [Qemu-devel] [PULL 49/69] block: Make supported_write_flags a per-bds property, (continued)
- [Qemu-devel] [PULL 49/69] block: Make supported_write_flags a per-bds property, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 35/69] virtio: Switch to byte-based aio block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 38/69] nand: Switch to byte-based block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 40/69] pflash: Switch to byte-based block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 59/69] qmp: add monitor command to add/remove a child, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 36/69] xen_disk: Switch to byte-based aio block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 42/69] m25p80: Switch to byte-based block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 69/69] qemu-iotests: iotests: fail hard if not run via "check", Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 43/69] atapi: Switch to byte-based block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 45/69] qemu-img: Switch to byte-based block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 52/69] block: Invalidate all children,
Kevin Wolf <=
- [Qemu-devel] [PULL 55/69] iotests: fix the redirection order in 083, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 64/69] qemu-io: Add 'write -f' to test FUA flag, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 66/69] block: add support for --image-opts in block I/O tests, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 67/69] block: add support for encryption secrets in block I/O tests, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 41/69] sd: Switch to byte-based block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 56/69] qemu-img: check block status of backing file when converting., Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 53/69] block: Drop superfluous invalidating bs->file from drivers, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 57/69] Add new block driver interface to add/delete a BDS's child, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 54/69] block: Inactivate all children, Kevin Wolf, 2016/05/12