qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3] qcow2: keep reference on zeroize with discard-no-unref en


From: Hanna Czenczek
Subject: Re: [PATCH v3] qcow2: keep reference on zeroize with discard-no-unref enabled
Date: Mon, 30 Oct 2023 18:03:24 +0100
User-agent: Mozilla Thunderbird

On 03.10.23 14:52, Jean-Louis Dupond wrote:
When the discard-no-unref flag is enabled, we keep the reference for
normal discard requests.
But when a discard is executed on a snapshot/qcow2 image with backing,
the discards are saved as zero clusters in the snapshot image.

When committing the snapshot to the backing file, not
discard_in_l2_slice is called but zero_in_l2_slice. Which did not had
any logic to keep the reference when discard-no-unref is enabled.

Therefor we add logic in the zero_in_l2_slice call to keep the reference
on commit.

Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1621
Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
---
  block/qcow2-cluster.c | 22 ++++++++++++++++++----
  qapi/block-core.json  |  7 ++++---
  qemu-options.hx       |  3 ++-
  3 files changed, 24 insertions(+), 8 deletions(-)

Thanks, applied to my block branch:

https://gitlab.com/hreitz/qemu/-/commits/block

Hanna




reply via email to

[Prev in Thread] Current Thread [Next in Thread]