On 12/1/23 20:14, Kevin Wolf wrote:
blk_unref() can't report any errors that happen while closing the image.
For example, if qcow2 hits an -ENOSPC error while writing out dirty
bitmaps when it's closed, it prints error messages to stderr, but
'qemu-img bitmap' won't see any error return value and will therefore
look successful with exit code 0.

In order to fix this, manually inactivate the image first before calling
blk_unref(). This already performs the operations that would be most
likely to fail while closing the image, but it can still return errors.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1330
Signed-off-by: Kevin Wolf <kw...@redhat.com>
---
  qemu-img.c | 11 +++++++++++
  1 file changed, 11 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>


Reply via email to