On Wed, 2018-06-06 at 17:30 +0200, Ján Tomko wrote:
[...]
> + 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.
I'd rather the check be here, where we raise the error message,
instead of relying on the fact that the other function will never
change in a way that will cause it not to check for >1.
--
Andrea Bolognani / Red Hat / Virtualization