提交 82e43ae1 编写于 作者: M Michal Privoznik

storage_conf: Make virStorageAuthDefFormat return void

This function returns nothing but zero. Therefore it makes no
sense to have it returning an integer.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 4e657f2a
...@@ -22902,10 +22902,8 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf, ...@@ -22902,10 +22902,8 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf,
* kept in the storage pool and would be overwritten anyway. * kept in the storage pool and would be overwritten anyway.
* So avoid formatting it for volumes. */ * So avoid formatting it for volumes. */
if (src->auth && src->authInherited && if (src->auth && src->authInherited &&
src->type != VIR_STORAGE_TYPE_VOLUME) { src->type != VIR_STORAGE_TYPE_VOLUME)
if (virStorageAuthDefFormat(&childBuf, src->auth) < 0) virStorageAuthDefFormat(&childBuf, src->auth);
goto error;
}
/* If we found encryption as a child of <source>, then format it /* If we found encryption as a child of <source>, then format it
* as we found it. */ * as we found it. */
...@@ -23101,10 +23099,8 @@ virDomainDiskDefFormat(virBufferPtr buf, ...@@ -23101,10 +23099,8 @@ virDomainDiskDefFormat(virBufferPtr buf,
/* Format as child of <disk> if defined there; otherwise, /* Format as child of <disk> if defined there; otherwise,
* if defined as child of <source>, then format later */ * if defined as child of <source>, then format later */
if (def->src->auth && !def->src->authInherited) { if (def->src->auth && !def->src->authInherited)
if (virStorageAuthDefFormat(buf, def->src->auth) < 0) virStorageAuthDefFormat(buf, def->src->auth);
return -1;
}
if (virDomainDiskSourceFormat(buf, def->src, def->startupPolicy, if (virDomainDiskSourceFormat(buf, def->src, def->startupPolicy,
flags, xmlopt) < 0) flags, xmlopt) < 0)
...@@ -23737,10 +23733,8 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf, ...@@ -23737,10 +23733,8 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf,
if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI && if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI &&
scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI && scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI &&
iscsisrc->src->auth) { iscsisrc->src->auth)
if (virStorageAuthDefFormat(buf, iscsisrc->src->auth) < 0) virStorageAuthDefFormat(buf, iscsisrc->src->auth);
return -1;
}
virBufferAdjustIndent(buf, -2); virBufferAdjustIndent(buf, -2);
if (!closedSource) if (!closedSource)
......
...@@ -953,10 +953,8 @@ virStoragePoolSourceFormat(virBufferPtr buf, ...@@ -953,10 +953,8 @@ virStoragePoolSourceFormat(virBufferPtr buf,
virBufferAsprintf(buf, "<format type='%s'/>\n", format); virBufferAsprintf(buf, "<format type='%s'/>\n", format);
} }
if (src->auth) { if (src->auth)
if (virStorageAuthDefFormat(buf, src->auth) < 0) virStorageAuthDefFormat(buf, src->auth);
return -1;
}
virBufferEscapeString(buf, "<vendor name='%s'/>\n", src->vendor); virBufferEscapeString(buf, "<vendor name='%s'/>\n", src->vendor);
virBufferEscapeString(buf, "<product name='%s'/>\n", src->product); virBufferEscapeString(buf, "<product name='%s'/>\n", src->product);
......
...@@ -1891,7 +1891,7 @@ virStorageAuthDefParse(xmlDocPtr xml, xmlNodePtr root) ...@@ -1891,7 +1891,7 @@ virStorageAuthDefParse(xmlDocPtr xml, xmlNodePtr root)
} }
int void
virStorageAuthDefFormat(virBufferPtr buf, virStorageAuthDefFormat(virBufferPtr buf,
virStorageAuthDefPtr authdef) virStorageAuthDefPtr authdef)
{ {
...@@ -1908,8 +1908,6 @@ virStorageAuthDefFormat(virBufferPtr buf, ...@@ -1908,8 +1908,6 @@ virStorageAuthDefFormat(virBufferPtr buf,
&authdef->seclookupdef); &authdef->seclookupdef);
virBufferAdjustIndent(buf, -2); virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</auth>\n"); virBufferAddLit(buf, "</auth>\n");
return 0;
} }
......
...@@ -367,7 +367,7 @@ int virStorageFileGetSCSIKey(const char *path, ...@@ -367,7 +367,7 @@ int virStorageFileGetSCSIKey(const char *path,
void virStorageAuthDefFree(virStorageAuthDefPtr def); void virStorageAuthDefFree(virStorageAuthDefPtr def);
virStorageAuthDefPtr virStorageAuthDefCopy(const virStorageAuthDef *src); virStorageAuthDefPtr virStorageAuthDefCopy(const virStorageAuthDef *src);
virStorageAuthDefPtr virStorageAuthDefParse(xmlDocPtr xml, xmlNodePtr root); virStorageAuthDefPtr virStorageAuthDefParse(xmlDocPtr xml, xmlNodePtr root);
int virStorageAuthDefFormat(virBufferPtr buf, virStorageAuthDefPtr authdef); void virStorageAuthDefFormat(virBufferPtr buf, virStorageAuthDefPtr authdef);
virSecurityDeviceLabelDefPtr virSecurityDeviceLabelDefPtr
virStorageSourceGetSecurityLabelDef(virStorageSourcePtr src, virStorageSourceGetSecurityLabelDef(virStorageSourcePtr src,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册