]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: Add 'usage' for encryption
authorJohn Ferlan <jferlan@redhat.com>
Mon, 30 May 2016 11:47:46 +0000 (07:47 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 1 Jul 2016 19:46:24 +0000 (15:46 -0400)
commit47e88b33befa1aafa4fd4db99c77a45c66d41c0a
treeab2fa1c7925f9319c9fd73e099cee306351d5f18
parentc84380106fe69f86842dc7e8c032af6740bef77e
util: Add 'usage' for encryption

In order to use more common code and set up for a future type, modify the
encryption secret to allow the "usage" attribute or the "uuid" attribute
to define the secret. The "usage" in the case of a volume secret would be
the path to the volume as dictated by the backwards compatibility brought
on by virStorageGenerateQcowEncryption where it set up the usage field as
the vol->target.path and didn't allow someone to provide it. This carries
into virSecretObjListFindByUsageLocked which takes the secret usage attribute
value from from the domain disk definition and compares it against the
usage type from the secret definition. Since none of the code dealing
with qcow/qcow2 encryption secrets uses usage for lookup, it's a mostly
cosmetic change. The real usage comes in a future path where the encryption
is expanded to be a luks volume and the secret will allow definition of
the usage field.

This code will make use of the virSecretLookup{Parse|Format}Secret common code.

Signed-off-by: John Ferlan <jferlan@redhat.com>
12 files changed:
docs/formatstorageencryption.html.in
docs/schemas/storagecommon.rng
src/qemu/qemu_process.c
src/storage/storage_backend.c
src/storage/storage_backend_fs.c
src/util/virstorageencryption.c
src/util/virstorageencryption.h
tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk-usage.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk-usage.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/qemuxml2xmlout-encrypted-disk-usage.xml [new symlink]
tests/qemuxml2xmltest.c