]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage_conf: Make virStorageAuthDefFormat return void
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 20 Feb 2018 11:24:36 +0000 (12:24 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 20 Feb 2018 12:06:22 +0000 (13:06 +0100)
This function returns nothing but zero. Therefore it makes no
sense to have it returning an integer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/conf/domain_conf.c
src/conf/storage_conf.c
src/util/virstoragefile.c
src/util/virstoragefile.h

index 3126cbb5b0cb9311492d376b0fa24b411ab9c3e6..362cab179898a6787514b0ce01855e72cd31e088 100644 (file)
@@ -22902,10 +22902,8 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf,
          * 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. */
@@ -23101,10 +23099,8 @@ virDomainDiskDefFormat(virBufferPtr buf,
 
     /* 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)
@@ -23737,10 +23733,8 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf,
 
     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)
index f808cd291e4fd7fc1af604296875bf8c8720c014..b9135722c189bb21cfc3deda42a8d5bc55a79a29 100644 (file)
@@ -953,10 +953,8 @@ virStoragePoolSourceFormat(virBufferPtr buf,
         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);
index f0b1d329c3074554ecb23251fbe826b27f10f19e..d1972d6d1d08a5bdb60d2ce6b325e8795cff6e9f 100644 (file)
@@ -1891,7 +1891,7 @@ virStorageAuthDefParse(xmlDocPtr xml, xmlNodePtr root)
 }
 
 
-int
+void
 virStorageAuthDefFormat(virBufferPtr buf,
                         virStorageAuthDefPtr authdef)
 {
@@ -1908,8 +1908,6 @@ virStorageAuthDefFormat(virBufferPtr buf,
                                 &authdef->seclookupdef);
     virBufferAdjustIndent(buf, -2);
     virBufferAddLit(buf, "</auth>\n");
-
-    return 0;
 }
 
 
index 9e8afa49326b8bd22b4c6bfab8ff77b89c34efba..0095cd1387b0d799b888be0dec7616fa3b547c6b 100644 (file)
@@ -367,7 +367,7 @@ int virStorageFileGetSCSIKey(const char *path,
 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,