]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: block: fix error when blockcopy target is librbd encrypted
authorOr Ozeri <oro@il.ibm.com>
Thu, 12 Jan 2023 09:04:01 +0000 (03:04 -0600)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 26 Jan 2024 08:52:19 +0000 (09:52 +0100)
commit66aee6e5c2b37314df29a611ccf0453f6770d1e1
treeff63e61c5acd4c0321323dde72ef164074a7b421
parentccfc5c1e1637d20e479fafde7aa3ea4c6fb29e21
qemu: block: fix error when blockcopy target is librbd encrypted

Encryption secrets are considered a format dependency, even
when being used by the storage node itself, as in the case of
using encryption engine=librbd.
Currently, the storage node is created (blockdev-add) before
creating the format dependencies (including encryption secrets).
As a result, when trying to perform a blockcopy when the target
disk uses librbd encryption, an error of this form is returned:

  "error: internal error: unable to execute QEMU command 'blockdev-add': No secret with id 'libvirt-5-format-encryption-secret0'"

To overcome this error, we change the order of commands so that
format dependencies are created BEFORE creating the storage node.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_block.c