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 1035001 - VHDX: journal log should not be replayed by default, but rather via qemu-img check -r all
Summary: VHDX: journal log should not be replayed by default, but rather via qemu-img ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jeff Cody
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-26 20:20 UTC by Jeff Cody
Modified: 2014-06-22 22:46 UTC (History)
6 users (show)

Fixed In Version: qemu-kvm-1.5.3-36.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1063559 (view as bug list)
Environment:
Last Closed: 2014-06-13 11:56:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jeff Cody 2013-11-26 20:20:21 UTC
The VHDX r/w driver replays dirty log journals on open, if the image file is opened r/w.  The problem with this approach is two-fold:  1.) If the VHDX image format is in a r/o whitelist, then journal logs can not be replayed, and 2) even when the image file is r/w, we may want to allow the image files to be cleaned up without needing to launch a full guest instance in r/w.


The solution for this is pretty straightforward:

1.) Have qemu-img check (.bdrv_check) for VHDX check the log integrity, and replay the log if '-r all' is passed to qemu-img check.

2.) Do not automatically replay the log on .bdrv_open (vhdx_open), and return error if .bdrv_open is called on a VHDX image file that contains a dirty log (even if opened r/w).

3.) Optionally add in a drive option for VHDX, to provide the option of replaying the log on open if desired, if the image is opened r/w.


These changes should be pretty straightforward, and allow for qemu to support VHDX log files even if VHDX is only in the read-only whitelist.

Comment 2 Jeff Cody 2013-12-17 16:38:39 UTC
Posted upstream:

http://lists.gnu.org/archive/html/qemu-devel/2013-12/msg03087.html

The agreed above behavior is as follows:

1.) If the image is opened r/o, and has a dirty log, provide a helpful error message instructing the user to run qemu-img check -r all, to replay the image.

2.) If the image is opened r/w, and has a dirty log, replay the log automatically as we currently do.


It should be noted that even without the patch above, running qemu-img check r- all on a VHDX image file will replay the log, even though an error is printed about VHDX not supporting 'check'.  This is because prior to that error, the image file was already opened r/w by qemu-img.

The patch posted upstream provides a .bdrv_check() implementation, and a useful error output.

Comment 4 Miroslav Rezanina 2014-01-14 18:42:57 UTC
Fix included in qemu-kvm-1.5.3-36.el7

Comment 8 Sibiao Luo 2014-02-11 03:07:30 UTC
Reproduce and verified this issue with the instruction of comment #2 and comment #7.

######Reproduced:
host info:
# uname -r && rpm -q qemu-kvm
3.10.0-76.el7.x86_64
qemu-kvm-1.5.3-35.el7.x86_64

Steps and Results:
1. If the image is opened r/o.
# qemu-img check -f vhdx tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx
qemu-img: Could not open 'tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx': Could not open 'tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx': Permission denied

2. If the image is opened r/w.
# qemu-img check -r all tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx
qemu-img: This image format does not support checks
# qemu-img check -f vhdx tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx
qemu-img: This image format does not support checks


######Verified:
host info:
# uname -r && rpm -q qemu-kvm
3.10.0-76.el7.x86_64
qemu-kvm-1.5.3-45.el7.x86_64

Steps and Results:
1. If the image is opened r/o, and has a dirty log, provide a helpful error message instructing the user to run qemu-img check -r all, to replay the image.
# qemu-img check -f vhdx tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx
qemu-img: Could not open 'tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx': VHDX image file 'tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx' opened read-only, but contains a log that needs to be replayed.  To replay the log, execute:
 qemu-img check -r all 'tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx': Operation not permitted

2. If the image is opened r/w, and has a dirty log, replay the log automatically as we currently do.
# qemu-img check -r all tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx
The following inconsistencies were found and repaired:

    0 leaked clusters
    1 corruptions

Double checking the fixed image now...
No errors were found on the image.
# qemu-img check -f vhdx tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx
No errors were found on the image.

Base on above, this issue has been fixed correctly, move to VERIFIED status, please correct me if any mistake, thanks in advance.

Best Regards,
sluo

Comment 10 Ludek Smid 2014-06-13 11:56:54 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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