]> xenbits.xensource.com Git - libvirt.git/commitdiff
virDomainDiskTranslateSourcePoolAuth: Take virStorageSourcePtr instead of virDomainDi...
authorPeter Krempa <pkrempa@redhat.com>
Wed, 5 Feb 2020 11:39:41 +0000 (12:39 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 10 Feb 2020 16:26:26 +0000 (17:26 +0100)
Only 'def->src' was ever used in this function. Use the source directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_conf.c

index ae6209620e57cffce1b8b06d72cccbaa4cdc884d..c72de7b3851a7baaa3eee9fdbe7590195052bf2c 100644 (file)
@@ -31377,18 +31377,18 @@ virDomainDiskAddISCSIPoolSourceHost(virStorageSourcePtr src,
 
 
 static int
-virDomainDiskTranslateSourcePoolAuth(virDomainDiskDefPtr def,
+virDomainDiskTranslateSourcePoolAuth(virStorageSourcePtr src,
                                      virStoragePoolSourcePtr source)
 {
     /* Only necessary when authentication set */
     if (!source->auth)
         return 0;
 
-    def->src->auth = virStorageAuthDefCopy(source->auth);
-    if (!def->src->auth)
+    src->auth = virStorageAuthDefCopy(source->auth);
+    if (!src->auth)
         return -1;
     /* A <disk> doesn't use <auth type='%s', so clear that out for the disk */
-    def->src->auth->authType = VIR_STORAGE_AUTH_TYPE_NONE;
+    src->auth->authType = VIR_STORAGE_AUTH_TYPE_NONE;
     return 0;
 }
 
@@ -31400,7 +31400,7 @@ virDomainDiskTranslateISCSIDirect(virDomainDiskDefPtr def,
     def->src->srcpool->actualtype = VIR_STORAGE_TYPE_NETWORK;
     def->src->protocol = VIR_STORAGE_NET_PROTOCOL_ISCSI;
 
-    if (virDomainDiskTranslateSourcePoolAuth(def,
+    if (virDomainDiskTranslateSourcePoolAuth(def->src,
                                              &pooldef->source) < 0)
         return -1;