[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 17/42] block: Use CAFs in bdrv_refresh_limits()
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v6 17/42] block: Use CAFs in bdrv_refresh_limits() |
Date: |
Fri, 9 Aug 2019 18:13:42 +0200 |
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
block/io.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/block/io.c b/block/io.c
index bcc770d336..dca4689b2f 100644
--- a/block/io.c
+++ b/block/io.c
@@ -135,6 +135,8 @@ static void bdrv_merge_limits(BlockLimits *dst, const
BlockLimits *src)
void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)
{
BlockDriver *drv = bs->drv;
+ BlockDriverState *storage_bs = bdrv_storage_bs(bs);
+ BlockDriverState *cow_bs = bdrv_filtered_cow_bs(bs);
Error *local_err = NULL;
memset(&bs->bl, 0, sizeof(bs->bl));
@@ -148,13 +150,13 @@ void bdrv_refresh_limits(BlockDriverState *bs, Error
**errp)
drv->bdrv_aio_preadv) ? 1 : 512;
/* Take some limits from the children as a default */
- if (bs->file) {
- bdrv_refresh_limits(bs->file->bs, &local_err);
+ if (storage_bs) {
+ bdrv_refresh_limits(storage_bs, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
}
- bdrv_merge_limits(&bs->bl, &bs->file->bs->bl);
+ bdrv_merge_limits(&bs->bl, &storage_bs->bl);
} else {
bs->bl.min_mem_alignment = 512;
bs->bl.opt_mem_alignment = getpagesize();
@@ -163,13 +165,13 @@ void bdrv_refresh_limits(BlockDriverState *bs, Error
**errp)
bs->bl.max_iov = IOV_MAX;
}
- if (bs->backing) {
- bdrv_refresh_limits(bs->backing->bs, &local_err);
+ if (cow_bs) {
+ bdrv_refresh_limits(cow_bs, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
}
- bdrv_merge_limits(&bs->bl, &bs->backing->bs->bl);
+ bdrv_merge_limits(&bs->bl, &cow_bs->bl);
}
/* Then let the driver override it */
--
2.21.0
- [Qemu-devel] [PATCH v6 11/42] block: Add bdrv_supports_compressed_writes(), (continued)
- [Qemu-devel] [PATCH v6 11/42] block: Add bdrv_supports_compressed_writes(), Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 12/42] block: Use bdrv_filtered_rw* where obvious, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 13/42] block: Use CAFs in block status functions, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 14/42] block: Use CAFs when working with backing chains, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 15/42] block: Re-evaluate backing file handling in reopen, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 16/42] block: Flush all children in generic code, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 17/42] block: Use CAFs in bdrv_refresh_limits(),
Max Reitz <=
- [Qemu-devel] [PATCH v6 18/42] block: Use CAFs in bdrv_refresh_filename(), Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 19/42] block: Use CAF in bdrv_co_rw_vmstate(), Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 20/42] block/snapshot: Fix fallback, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 21/42] block: Use CAFs for debug breakpoints, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 22/42] block: Fix bdrv_get_allocated_file_size's fallback, Max Reitz, 2019/08/09