Bug 1658525

Summary: qemu-img measure ignores preallocation=metadata option
Product: [Fedora] Fedora Reporter: Vojtech Juranek <vjuranek>
Component: qemuAssignee: Fedora Virtualization Maintainers <virt-maint>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 28CC: amit, berrange, cfergeau, crobinso, dwmw2, itamar, pbonzini, rjones, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-21 15:25:15 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:

Description Vojtech Juranek 2018-12-12 11:23:29 UTC
Description of problem:
qemu-img measure ignores options preallocation=metadata and returns same result as if this option is not provided, returning wrong result for images preallocated with metadata.

Version-Release number of selected component (if applicable):
qemu-img-2.11.2-4

How reproducible:
always

Steps to Reproduce:
vjuranek@localhost vb$ qemu-img create test.img 1m                                                                                                                                                                                        
Formatting 'test.img', fmt=raw size=1048576

vjuranek@localhost vb$ qemu-img measure -f raw -O qcow2 -o preallocation=metadata test.img
required size: 327680
fully allocated size: 1376256

vjuranek@localhost vb$ qemu-img measure -f raw -O qcow2 test.img                                                                                                                                                
required size: 327680
fully allocated size: 1376256

vjuranek@localhost vb$ qemu-img measure -f raw -O qcow2 -o preallocation=metadata test.img                                                                                                                                                
required size: 327680
fully allocated size: 1376256

vjuranek@localhost vb$ qemu-img convert -f raw -O qcow2 -o preallocation=metadata test.img test-prelloc-metadata.qcow2                                                                                                                    
vjuranek@localhost vb$ ls -la test-prelloc-metadata.qcow2                                                                                                                                                                                 
-rw-r--r--. 1 vjuranek vjuranek 1376256 pro 12 12:19 test-prelloc-metadata.qcow2

Actual results:
required size is 327680

Expected results:
required size is equal or higher than 1376256

Additional info:

Comment 1 Ben Cotton 2019-05-02 20:08:51 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Cole Robinson 2019-05-21 15:25:15 UTC
Vojtech if you're still seeing this issue on latest Fedora, please file an upstream qemu bug: https://www.qemu.org/contribute/report-a-bug/