Bug 1654639 - [rhel.8.0][fast train]qemu-img shouldn't truncate image while creating qcow2 file with invalid option values
Summary: [rhel.8.0][fast train]qemu-img shouldn't truncate image while creating qcow2 ...
Keywords:
Status: CLOSED DUPLICATE of bug 1648184
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 8.0
Assignee: Hanna Czenczek
QA Contact: Tingting Mao
URL:
Whiteboard:
: 1613215 (view as bug list)
Depends On: 1613215
Blocks: 1649160
TreeView+ depends on / blocked
 
Reported: 2018-11-29 10:16 UTC by Tingting Mao
Modified: 2019-02-22 22:10 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1613215
Environment:
Last Closed: 2019-02-01 17:05:25 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Tingting Mao 2018-11-29 10:16:57 UTC
+++ This bug was initially created as a clone of Bug #1613215 +++

Description of problem:
Qemu-img should create no file when the value of supported option is not correct.

Version-Release number of selected component (if applicable):
qemu-kvm-3.1.0-0.el8.rc2
kernel-4.18.0-45.el8

How reproducible:
100%

Steps to Reproduce:
1.Create qcow2 image with unsupported value of option
# qemu-img create -f qcow2 -o preallocation=xxxxtt test02.qcow2 1G
Formatting 'test02.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 preallocation=xxxxtt lazy_refcounts=off refcount_bits=16
qemu-img: test02.qcow2: Invalid parameter 'xxxxtt'
# qemu-img create -f qcow2 -o cluster_size=0 test03.qcow2 1G
Formatting 'test03.qcow2', fmt=qcow2 size=1073741824 cluster_size=0 lazy_refcounts=off refcount_bits=16
qemu-img: test03.qcow2: Cluster size must be a power of two between 512 and 2048k
2.Check the info of the images created in step1
# qemu-img info test02.qcow2 
image: test02.qcow2
file format: raw
virtual size: 0 (0 bytes)
disk size: 0
# qemu-img info test03.qcow2 
image: test03.qcow2
file format: raw
virtual size: 0 (0 bytes)
disk size: 0


Actual results:

Expected results:
There should be no images when specifying the wrong value of the option.


Additional info:
The result is as expected for raw image[1].
And there is no file in qemu-kvm-rhev-2.10.0[2]. So I mark this issue as regression.

[1]# qemu-img create -f raw -o preallocation=tttxxx test03.img 1G
Formatting 'test03.img', fmt=raw size=1073741824 preallocation=tttxxx
qemu-img: test03.img: invalid parameter value: tttxxx
# qemu-img info test03.img
qemu-img: Could not open 'test03.img': Could not open 'test03.img': No such file or directory

[2]# qemu-img --version
qemu-img version 2.10.0(qemu-kvm-rhev-2.10.0-21.el7_5.1)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
# qemu-img create -f qcow2 -o preallocation=xxxxtt test02.qcow2 1G
Formatting 'test02.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 preallocation=xxxxtt lazy_refcounts=off refcount_bits=16
qemu-img: test02.qcow2: invalid parameter value: xxxxtt
# qemu-img info test02.qcow2
qemu-img: Could not open 'test02.qcow2': Could not open 'test02.qcow2': No such file or directory

Comment 3 Ademar Reis 2019-02-01 17:02:51 UTC
*** Bug 1613215 has been marked as a duplicate of this bug. ***

Comment 4 Ademar Reis 2019-02-01 17:05:25 UTC

*** This bug has been marked as a duplicate of bug 1648184 ***


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