mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
util: Check for duplicated id in virStorageSourceParseRBDColonString
If we find multiple "id=" strings during processing, then we need to force an error since we cannot have multiple <auth>'s defined for a single source volume. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
466a3e5dfa
commit
b20e957d0a
@ -2840,6 +2840,11 @@ virStorageSourceParseRBDColonString(const char *rbdstr,
|
||||
|
||||
if (STRPREFIX(p, "id=")) {
|
||||
/* formulate authdef for src->auth */
|
||||
if (src->auth) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("duplicate 'id' found in '%s'"), src->path);
|
||||
return -1;
|
||||
}
|
||||
if (VIR_ALLOC(authdef) < 0)
|
||||
return -1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user