diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 554fc757ed84ea11783ee244bb75d96fb18d49a8..87f2115869e9274e457d52c72030dd08f4f0f01d 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -1277,6 +1277,13 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool, return NULL; } + if (enc->nsecrets != 1) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("A single " + "element is expected in encryption description")); + return NULL; + } + conn = virGetConnectSecret(); if (!conn) return NULL;