On 07/24/2017 11:26 PM, lampahome wrote: > I thought 2.9.0 is the latest and check to the wrong commit. You're still top-posting, even after being told not to: http://www.caliburn.nl/topposting.html > Now it supports encryption. > > My cmd is: > >> qemu-nbd --object secret,id=sec0,file=passwd.txt,format=raw \ >> --image-opts >> driver=qcow2,file.filename=demo.qcow2,encrypt.format=luks,encrypt.key-secret=sec0 This says to open an existing already-encrypted image... > > But it shows error message: > >> No encryption in image header, but options specified format 'luks' ...and this says your image was not already encrypted. > > Something wrong? > > My procedure is below: > 1. create a clean demo.qcow2 image(no compression, no encryption) > 2. use the cmd above to encrypt the demo.qcow2 image Indeed, if you want an encrypted image, you must create it encrypted up front (you can't do an in-place encryption after the fact). qemu-img convert is probably the easiest way to copy a non-encrypted image to a newly-created encrypted image. > > 2017-07-24 20:25 GMT+08:00 Eric Blake : > >> On 07/23/2017 08:49 PM, 陳培泓 wrote: >>> I check to the newest version of qemu. >> >> You're still top-posting, which makes it really hard to answer your >> questions. Here's where I previously asked you to avoid top-posting. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org