Description of problem:
Converting a raw format image to itself, we should let qemu-img convert unshare the write permission. Locking automatically like qcow2 image.
Discussed it with Kevin before, he had sent out the patches. Report this bug to track it.
He said these patches have been merged only after the 6.0 release, immediately after the 6.1 development tree had opened.
commit 0b8fb55ce6398d7277b5ba0f19e39ec30a058191
[PATCH 0/2] qemu-img convert: Unshare write permission for source
commit 35b7f4abd5afe159f91ddeb4f2a40c20d2f48367
[PATCH 1/2] block: Add BDRV_O_NO_SHARE for blk_new_open()
Version-Release number of selected component (if applicable):
kernel-4.18.0-310.el8.x86_64
qemu-kvm-6.0.0-20.module+el8.5.0+11499+199527ef
How reproducible:
100%
Steps to Reproduce:
1. create a raw format image
# qemu-img create -f raw test.img 2G
2. Convert the image to itself
# qemu-img convert -p -f raw -O raw -S 0 test.img test.img
Actual results:
after step 2, convert successfully.
(100.00/100%)
Expected results:
Failed to convert image, locking automatically like qcow2 image.
The output like 'qemu-img: test.img: error while converting raw: Failed to get "write" lock
Is another process using the image [test.img]?'
Additional info:
Comment 1Klaus Heinrich Kiwi
2021-06-28 19:40:19 UTC
Can we set this one to POST? Do we need to backport to 8.5 AV, or will we rebase it with 6.1+?
Verified this bug as below:
Tested with:
qemu-kvm-6.1.0-1.module+el8.6.0+12535+4e2af250
kernel-4.18.0-339.el8.x86_64
Steps:
# qemu-img create -f raw test.img 2G
# qemu-img convert -p -f raw -O raw -S 0 test.img test.img
qemu-img: test.img: error while converting raw: Failed to get "write" lock
Is another process using the image [test.img]?
Results:
As above, the image is locked.