[libvirt] [PATCH] storage: minor fix in luks encrypted volume creation
Ján Tomko
jtomko at redhat.com
Wed Jun 6 15:30:27 UTC 2018
s/minor fix/fix crash/ in the title
On Wed, Jun 06, 2018 at 04:54:20PM +0200, Katerina Koukiou wrote:
>This patch fixes the case when creating a luks encrypted volume
s/This patch fixes/Fix/
>via an xml file without 'secret' element.
>libvirtd was receiving SIGSEGV, now proper error is reported for
>the missing element.
>(see bz 1468422)
Please use a clickable bugzilla link on a separated line:
https://bugzilla.redhat.com/show_bug.cgi?id=1468422
>
>Signed-off-by: Katerina Koukiou <kkoukiou at redhat.com>
>---
> src/storage/storage_util.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
>diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
>index 554fc757ed..18414ddb89 100644
>--- a/src/storage/storage_util.c
>+++ b/src/storage/storage_util.c
>@@ -1277,6 +1277,13 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool,
> return NULL;
> }
>
>+ if (!enc->secrets) {
You can use enc->secrets != 1, to match the error message.
But the > 1 cause will be caught anyway later in
storageBackendCreateQemuImgCheckEncryption which cannot be simply called
before here because the code is overly complicated.
With the bug link fixed:
Reviewed-by: Ján Tomko <jtomko at redhat.com>
Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180606/ef1d63ac/attachment-0001.sig>
More information about the libvir-list
mailing list