Hide Forgot
Description of problem: Create a qcow2 block and with "-o encryption" option. Boot a guest and attach the disk. Then change the disk password by "block_passwd" command. Shutdown guest and boot again, I need to input block password to resume the guest. But I find inputting any string or even input nothing and only need to press "enter" key could resume the guest. Version-Release number of selected component (if applicable): kernel-2.6.32-171.el6.x86_64 qemu-kvm-0.12.1.2-2.172.el6.x86_64 How reproducible: Always Steps to Reproduce: 1. Create a disk: # qemu-img create -f qcow2 disk-1.qcow2 2G -o encryption Formatting 'disk-1.qcow2', fmt=qcow2 size=2147483648 encryption=on cluster_size=65536 2.Boot a pre-installed guest and attach the encrypted disk. /usr/libexec/qemu-kvm -m 2G -smp 2 -cpu cpu64-rhel6,+x2apic -usbdevice tablet -drive file=win7-64-virtio-new.qcow2,format=qcow2,if=none,id=drive-ide0-0-0,werror=stop,rerror=stop,cache=none,boot=on -device virtio-blk-pci,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device e1000,netdev=hostnet0,mac=00:10:2a:20:06:58,bus=pci.0,addr=0x6 -boot c -uuid 055a379d-a3e8-46a3-8a4c-fe4418714e0f -rtc-td-hack -no-kvm-pit-reinjection -monitor stdio -qmp tcp:0:4445,server,nowait -name win7-64-balloon -spice port=5931,disable-ticketing -vga qxl -device virtio-balloon-pci,bus=pci.0,id=balloon0 -drive file=disk-1.qcow2,format=qcow2,if=none,id=virtio1,werror=stop,rerror=stop,cache=none -device virtio-blk-pci,drive=virtio1,id=virtio1 3.change a password for the disk. (qemu) info status VM status: paused (qemu) block_passwd virtio1 redhat (qemu) 4. shutdown guest and then reboot again 5. Check the status and input the password to resume guest. (qemu) info status VM status: paused (qemu) (qemu) c virtio1 (disk-1.qcow2) is encrypted. Password: ************ handle_dev_input: start (qemu) Actual results: In step5, input any number/letter/string or input nothing can resume the guest. Expected results: Password should work. Additional info:
If you enter nothing or a different password you won't be able to read out what you wrote to the disk. You'll read garbage instead. For example, if you added a step "3b. Create a file system on the encrypted disk", you wouldn't be able to mount it after step 5.