]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Don't assume secret provided for LUKS encryption
authorJohn Ferlan <jferlan@redhat.com>
Thu, 22 Dec 2016 12:12:49 +0000 (07:12 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 3 Jan 2017 17:59:18 +0000 (12:59 -0500)
commit7f7d99048350935a394d07b98a13d7da9c4b0502
tree84a44188f37423d11e300c59776a097c25b277a4
parent0735ddf744f95cd9f88c5f8465b1a64883710d37
qemu: Don't assume secret provided for LUKS encryption

https://bugzilla.redhat.com/show_bug.cgi?id=1405269

If a secret was not provided for what was determined to be a LUKS
encrypted disk (during virStorageFileGetMetadata processing when
called from qemuDomainDetermineDiskChain as a result of hotplug
attach qemuDomainAttachDeviceDiskLive), then do not attempt to
look it up (avoiding a libvirtd crash) and do not alter the format
to "luks" when adding the disk; otherwise, the device_add would
fail with a message such as:

   "unable to execute QEMU command 'device_add': Property 'scsi-hd.drive'
    can't find value 'drive-scsi0-0-0-0'"

because of assumptions that when the format=luks that libvirt would have
provided the secret to decrypt the volume.

Access to unlock the volume will thus be left to the application.
src/qemu/qemu_command.c
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_hotplug.c