[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Qemu secret object not valid UTF-8 error reported

From: Peter Luo
Subject: Qemu secret object not valid UTF-8 error reported
Date: Thu, 07 May 2020 14:00:49 +0800
User-agent: Microsoft-MacOutlook/10.1b.0.190715



I’m using qemu-img to create a luks encrypted image, and the secret object is defined to use base64 format. 

I was expecting the secret content should be arbitrary bytes when using base64 format as per the qemu document. I also copied in the below.



# @QCryptoSecretFormat:


# The data format that the secret is provided in


# @raw: raw bytes. When encoded in JSON only valid UTF-8 sequences can be used

# @base64: arbitrary base64 encoded binary data

# Since: 2.6


{ 'enum': 'QCryptoSecretFormat',




  'data': ['raw', 'base64']} 


However qemu complains not valid UTF-8 and reports an error.


root@host:~# qemu-img create --object secret,id=vol-zk0brve6.secret,format=base64,data="" -o encrypt.format=luks,encrypt.key-secret=vol-zk0brve6.secret,encrypt.cipher-alg=aes-256 -f qcow2 1.img 10G

Formatting '1.img', fmt=qcow2 size=10737418240 encrypt.format=luks encrypt.key-secret=vol-zk0brve6.secret encrypt.cipher-alg=aes-256 cluster_size=65536 lazy_refcounts=off refcount_bits=16

qemu-img: 1.img: Data from secret vol-zk0brve6.secret is not valid UTF-8


root@host:~# qemu-img --version

qemu-img version

Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers


Am I using qemu-img in a wrong way?



Peter Luo


reply via email to

[Prev in Thread] Current Thread [Next in Thread]