[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/6] qcow2: Resize the cache upon image resizing
From: |
Leonid Bloch |
Subject: |
[Qemu-devel] [PATCH 6/6] qcow2: Resize the cache upon image resizing |
Date: |
Mon, 30 Jul 2018 00:27:44 +0300 |
The caches are now recalculated upon image resizing. This is done
because the new default behavior of assigning a sufficient L2 cache to
cover the entire image implies that the cache will still be sufficient
after image resizing. To put a limit on the cache, the options
cache-size and l2-cache-size can be used.
Signed-off-by: Leonid Bloch <address@hidden>
---
block/qcow2.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 74f2cb10a4..06fac1bb8c 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3656,6 +3656,12 @@ static int coroutine_fn
qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
}
s->l1_vm_state_index = new_l1_size;
+ /* Update cache sizes */
+ QDict *options = qdict_clone_shallow(bs->options);
+ ret = qcow2_update_options(bs, options, s->flags, errp);
+ if (ret < 0) {
+ goto fail;
+ }
ret = 0;
fail:
qemu_co_mutex_unlock(&s->lock);
--
2.17.1
- [Qemu-devel] [PATCH 0/6] qcow2: Make the L2 cache cover the whole image by default, Leonid Bloch, 2018/07/29
- [Qemu-devel] [PATCH 5/6] qcow2: Make the default L2 cache sufficient to cover the entire image, Leonid Bloch, 2018/07/29
- [Qemu-devel] [PATCH 1/6 for-3.0] Update .gitignore, Leonid Bloch, 2018/07/29
- [Qemu-devel] [PATCH 6/6] qcow2: Resize the cache upon image resizing,
Leonid Bloch <=
- [Qemu-devel] [PATCH 2/6 for-3.0] qcow2: A grammar fix in conflicting cache sizing error message, Leonid Bloch, 2018/07/29
- [Qemu-devel] [PATCH 3/6 for-3.0] qcow2: Options' documentation fixes, Leonid Bloch, 2018/07/29
- [Qemu-devel] [PATCH 4/6] qcow2: Update total_sectors when resizing the image, Leonid Bloch, 2018/07/29
- Re: [Qemu-devel] [PATCH 0/6] qcow2: Make the L2 cache cover the whole image by default, Kevin Wolf, 2018/07/30