Bug 1063559

Summary: VHDX: journal log should not be replayed by default, but rather via qemu-img check -r all
Product: Red Hat Enterprise Linux 6 Reporter: Sibiao Luo <sluo>
Component: qemu-kvmAssignee: Jeff Cody <jcody>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: bsarathy, jcody, juzhang, michen, mkenneth, qzhang, rbalakri, sluo, virt-maint
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.431.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1035001 Environment:
Last Closed: 2014-10-14 06:55:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1006159    
Bug Blocks:    

Comment 1 Sibiao Luo 2014-02-11 03:12:29 UTC
host info:
# uname -r && rpm -q qemu-kvm-rhev
2.6.32-425.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.420.el6.x86_64

# qemu-img check tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx
Could not open 'tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx': Operation not supported

# qemu-img check -r all tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx
Could not open 'tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx': Operation not supported

Best Regards,
sluo

Comment 3 Jeff Cody 2014-06-22 22:46:04 UTC
Reopening, to go along with BZ 1006159

Comment 5 Miroslav Rezanina 2014-07-23 10:34:57 UTC
Fix included in qemu-kvm-0.12.1.2-2.431.el6

Comment 7 Sibiao Luo 2014-07-28 09:25:44 UTC
######Reproduced:
host info:
# uname -r && rpm -q qemu-kvm-rhev
2.6.32-493.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.428.el6.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
Could not open 'tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx': Operation not supported

2. If the image is opened r/w.
# qemu-img check -r all tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx
Could not open 'tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx': Operation not supported

# qemu-img check -f vhdx tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx
Could not open 'tests_qemu-iotests_sample_images_iotest-dirtylog-10G-4M.vhdx': Operation not supported

######Verified:
# uname -r && rpm -q qemu-kvm-rhev
2.6.32-493.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.431.el6.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
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'
Could not open '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 8 errata-xmlrpc 2014-10-14 06:55:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1490.html