* kept in the storage pool and would be overwritten anyway.
* So avoid formatting it for volumes. */
if (src->auth && src->authInherited &&
- src->type != VIR_STORAGE_TYPE_VOLUME) {
- if (virStorageAuthDefFormat(&childBuf, src->auth) < 0)
- goto error;
- }
+ src->type != VIR_STORAGE_TYPE_VOLUME)
+ virStorageAuthDefFormat(&childBuf, src->auth);
/* If we found encryption as a child of <source>, then format it
* as we found it. */
/* Format as child of <disk> if defined there; otherwise,
* if defined as child of <source>, then format later */
- if (def->src->auth && !def->src->authInherited) {
- if (virStorageAuthDefFormat(buf, def->src->auth) < 0)
- return -1;
- }
+ if (def->src->auth && !def->src->authInherited)
+ virStorageAuthDefFormat(buf, def->src->auth);
if (virDomainDiskSourceFormat(buf, def->src, def->startupPolicy,
flags, xmlopt) < 0)
if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI &&
scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI &&
- iscsisrc->src->auth) {
- if (virStorageAuthDefFormat(buf, iscsisrc->src->auth) < 0)
- return -1;
- }
+ iscsisrc->src->auth)
+ virStorageAuthDefFormat(buf, iscsisrc->src->auth);
virBufferAdjustIndent(buf, -2);
if (!closedSource)
virBufferAsprintf(buf, "<format type='%s'/>\n", format);
}
- if (src->auth) {
- if (virStorageAuthDefFormat(buf, src->auth) < 0)
- return -1;
- }
+ if (src->auth)
+ virStorageAuthDefFormat(buf, src->auth);
virBufferEscapeString(buf, "<vendor name='%s'/>\n", src->vendor);
virBufferEscapeString(buf, "<product name='%s'/>\n", src->product);
}
-int
+void
virStorageAuthDefFormat(virBufferPtr buf,
virStorageAuthDefPtr authdef)
{
&authdef->seclookupdef);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</auth>\n");
-
- return 0;
}
void virStorageAuthDefFree(virStorageAuthDefPtr def);
virStorageAuthDefPtr virStorageAuthDefCopy(const virStorageAuthDef *src);
virStorageAuthDefPtr virStorageAuthDefParse(xmlDocPtr xml, xmlNodePtr root);
-int virStorageAuthDefFormat(virBufferPtr buf, virStorageAuthDefPtr authdef);
+void virStorageAuthDefFormat(virBufferPtr buf, virStorageAuthDefPtr authdef);
virSecurityDeviceLabelDefPtr
virStorageSourceGetSecurityLabelDef(virStorageSourcePtr src,