[libvirt] [PATCH] storage: minor fix in luks encrypted volume creation
Andrea Bolognani
abologna at redhat.com
Wed Jun 6 15:30:15 UTC 2018
On Wed, 2018-06-06 at 16:54 +0200, Katerina Koukiou wrote:
> This patch fixes the case when creating a luks encrypted volume
> via an xml file without 'secret' element.
> libvirtd was receiving SIGSEGV, now proper error is reported for
> the missing element. (see bz 1468422)
Something like
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468422
would be better, as it disambiguates which specifica Bugzilla
instance you're talking about and allows users to jump straight
to the bug report.
[...]
> + if (!enc->secrets) {
> + virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> + _("A single <secret type='passphrase'...> "
> + "element is expected in encryption description"));
> + return NULL;
> + }
I'm not very familiar with this area of libvirt, but I would
probably error out when
enc->nsecrets != 1
instead.
Reporting this as VIR_ERR_INTERNAL_ERROR also doesn't look quite
right; VIR_ERR_INVALID_ARG would certainly be more appropriate for
something that happened because the user provided less information
than expected.
Hopefully someone more authoritative will chime in: to be
completely honest, I really just wanted to comment on the commit
message bit :)
--
Andrea Bolognani / Red Hat / Virtualization
More information about the libvir-list
mailing list