Bug 1776747
Summary: | 'qemu-img create' should restrict the 'size' input while there is both '-o size' and size value at the last argument | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Tingting Mao <timao> | |
Component: | qemu-kvm | Assignee: | Kevin Wolf <kwolf> | |
qemu-kvm sub component: | Storage | QA Contact: | Xueqiang Wei <xuwei> | |
Status: | CLOSED ERRATA | Docs Contact: | ||
Severity: | low | |||
Priority: | low | CC: | coli, jinzhao, juzhang, kwolf, mrezanin, qzhang, virt-maint | |
Version: | 8.2 | |||
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | qemu-kvm-5.0.0-0.module+el8.3.0+6620+5d5e1420 | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1849930 (view as bug list) | Environment: | ||
Last Closed: | 2020-11-17 17:45:34 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: | ||||
Bug Blocks: | 1849930 |
Description
Tingting Mao
2019-11-26 10:04:40 UTC
Looks like Kevin sent out a patch while I was editing this BZ. Reassigning: Date: Tue, 26 Nov 2019 16:48:35 +0100 From: Kevin Wolf <kwolf> Subject: [PATCH] block: Error out on image creation with conflicting size options To: qemu-block Cc: kwolf, qemu-devel If both the create options (qemu-img create -o ...) and the size parameter were given, the size parameter was silently ignored. Instead, make specifying two sizes an error. Signed-off-by: Kevin Wolf <kwolf> --- block.c | 10 ++++++++-- tests/qemu-iotests/049 | 5 +++++ tests/qemu-iotests/049.out | 5 +++++ 3 files changed, 18 insertions(+), 2 deletions(-) QEMU has been recently split into sub-components and as a one-time operation to avoid breakage of tools, we are setting the QEMU sub-component of this BZ to "General". Please review and change the sub-component if necessary the next time you review this BZ. Thanks This is upstream commit f6dc1c31d3. Probably not worth a backport, so we'll get it by rebase. Also hit it on rhel8.2.1 versions: kernel-4.18.0-193.1.2.el8_2.x86_64 qemu-kvm-4.2.0-26.module+el8.2.1+7079+67e06423 For qcow2: # qemu-img create -f qcow2 -o size=2G test.qcow2 3G Formatting 'test.qcow2', fmt=qcow2 size=2147483648 cluster_size=65536 lazy_refcounts=off refcount_bits=16 # qemu-img info test.qcow2 image: test.qcow2 file format: qcow2 virtual size: 2 GiB (2147483648 bytes) disk size: 196 KiB cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false For raw: # qemu-img create -f raw -o size=2G test.img 3G Formatting 'test.img', fmt=raw size=2147483648 # qemu-img info test.img image: test.img file format: raw virtual size: 2 GiB (2147483648 bytes) disk size: 4 KiB For luks: # qemu-img create -f luks --object secret,id=sec0,data=redhat -o key-secret=sec0,size=2G base.luks 3G Formatting 'base.luks', fmt=luks size=2147483648 key-secret=sec0 # qemu-img info base.luks image: base.luks file format: luks virtual size: 2 GiB (2147483648 bytes) disk size: 256 KiB encrypted: yes Format specific information: ivgen alg: plain64 hash alg: sha256 cipher alg: aes-256 uuid: f62a42ea-0e6b-421e-80e8-36b507283c08 cipher mode: xts slots: [0]: active: true iters: 1141742 key offset: 4096 stripes: 4000 [1]: active: false key offset: 262144 [2]: active: false key offset: 520192 [3]: active: false key offset: 778240 [4]: active: false key offset: 1036288 [5]: active: false key offset: 1294336 [6]: active: false key offset: 1552384 [7]: active: false key offset: 1810432 payload offset: 2068480 master key iters: 286007 Tested it on rhel8.3.0 fast train, not hit this issue. Versions: kernel-4.18.0-209.el8.x86_64 qemu-kvm-5.0.0-0.module+el8.3.0+6620+5d5e1420 For qcow2: # qemu-img create -f qcow2 -o size=2G test.qcow2 3G qemu-img: test.qcow2: The image size must be specified only once For raw: # qemu-img create -f raw -o size=2G test.img 3G qemu-img: test.img: The image size must be specified only once For luks: # qemu-img create -f luks --object secret,id=sec0,data=redhat -o key-secret=sec0,size=2G base.luks 3G qemu-img: base.luks: The image size must be specified only once According to Comment 7, set status to VERIFIED. Thanks. 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 (virt:8.3 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:5137 |