RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1975940 - qemu-img convert: unshare write permission for source
Summary: qemu-img convert: unshare write permission for source
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: qemu-kvm
Version: 8.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.6
Assignee: Kevin Wolf
QA Contact: Tingting Mao
URL:
Whiteboard:
Depends On: 1997410
Blocks: 1975941
TreeView+ depends on / blocked
 
Reported: 2021-06-24 19:10 UTC by Xueqiang Wei
Modified: 2021-12-07 22:45 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1975941 (view as bug list)
Environment:
Last Closed: 2021-09-17 07:56:11 UTC
Type: ---
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)

Description Xueqiang Wei 2021-06-24 19:10:30 UTC
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 1 Klaus 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+?

Comment 2 Kevin Wolf 2021-06-29 11:26:19 UTC
We should set POST only together with the other information, but yes, you're right that waiting for the rebase is good enough for this one.

Comment 3 John Ferlan 2021-09-09 11:56:57 UTC
Bulk update: Move RHEL-AV bugs to RHEL8 with existing RHEL9 clone.

Comment 4 John Ferlan 2021-09-09 11:58:16 UTC
Please provide qa_ack+/ITM as this is resolved by qemu-6.1 rebase bug 1997410

Comment 5 Tingting Mao 2021-09-10 05:56:58 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.