Bug 1594864

Summary: qemu-img create -f luks: preallocation option is accepted, but doesn't work
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Ademar Reis <areis>
Component: qemu-kvmAssignee: Maxim Levitsky <mlevitsk>
Status: CLOSED DUPLICATE QA Contact: Tingting Mao <timao>
Severity: medium Docs Contact:
Priority: medium    
Version: ---CC: berrange, chayang, coli, eblake, juzhang, knoel, lolyu, ngu, pingl, rbalakri, timao, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1534951 Environment:
Last Closed: 2019-07-11 11:37:39 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: 1534951    
Bug Blocks:    

Description Ademar Reis 2018-06-25 14:51:29 UTC
qemu-img create -f luks -o preallocation=full works (it was originally reported as returning error, see bug 1534951), but this is not supported with LUKS and the image is not preallocated.

This BZ is about changing that behavior to return error until preallocation is supported (tracked in bug 1534951). Need to confirm if this is a regression.

How to reproduce:

$ qemu-img create -f luks -o ?
Supported options:
size             Virtual disk size
key-secret       ID of the secret that provides the keyslot passphrase
cipher-alg       Name of encryption cipher algorithm
cipher-mode      Name of encryption cipher mode
ivgen-alg        Name of IV generator algorithm
ivgen-hash-alg   Name of IV generator hash algorithm
hash-alg         Name of encryption hash algorithm
iter-time        Time to spend in PBKDF in milliseconds

$ qemu-img create -f luks --object secret,id=sec0,data=base -o key-secret=sec0 base.luks 1G -o preallocation=full
Formatting 'base.luks', fmt=luks size=1073741824 key-secret=sec0 preallocation=full

[ademar@optimus ~]$ qemu-img info base.luks | head -n 5
image: base.luks
file format: luks
virtual size: 1.0G (1073741824 bytes)
disk size: 256K
encrypted: yes

$ qemu-img --version
qemu-img version 2.12.0 (qemu-2.12.0-1.fc27)

+++ This bug was initially created as a clone of Bug #1534951 +++

Comment 3 Ademar Reis 2018-12-21 23:10:16 UTC
See also bug #1534951.