mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: Requires either uuid or usage of secret
As the RNG schema for disk auth secret implies, it requires either
"uuid" or "usage":
<define name='diskAuthSecret'>
<element name='secret'>
<attribute name='type'>
<choice>
<value>ceph</value>
<value>iscsi</value>
</choice>
</attribute>
<choice>
<attribute name='uuid'>
<ref name="UUID"/>
</attribute>
<attribute name='usage'>
<ref name='genericName'/>
</attribute>
</choice>
</element>
</define>
This commit is contained in:
committed by
Jiri Denemark
parent
adb7b0b562
commit
9b8ee6d0f2
@@ -4972,6 +4972,14 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
|
||||
_("only one of uuid and usage can be specified"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!authUUID && !authUsage) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("either uuid or usage should be "
|
||||
"specified for a secret"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (authUUID != NULL) {
|
||||
def->auth.secretType = VIR_DOMAIN_DISK_SECRET_TYPE_UUID;
|
||||
if (virUUIDParse(authUUID,
|
||||
|
||||
Reference in New Issue
Block a user