]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: domain: Process only one object in qemuDomainPrepareDiskSourceTLS
authorPeter Krempa <pkrempa@redhat.com>
Wed, 30 May 2018 10:48:34 +0000 (12:48 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 5 Jun 2018 06:13:58 +0000 (08:13 +0200)
Remove the loop from qemuDomainPrepareDiskSourceTLS and rename it to
qemuDomainPrepareStorageSourceTLS. Currently there is no backing chain
to prepare so fixing one device is equivalent. In the future it will be
reused in a function which will do the looping.

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

index 308eea65a95bebbb5f0275a22705e8be9855f732..e75b1d63423eead053d7f46bcda570bdfd654f22 100644 (file)
@@ -9955,7 +9955,7 @@ qemuProcessPrepareStorageSourceTLSVxhs(virStorageSourcePtr src,
 
 
 /* qemuProcessPrepareDiskSourceTLS:
- * @source: pointer to host interface data for disk device
+ * @source: source for a disk
  * @cfg: driver configuration
  *
  * Updates host interface TLS encryption setting based on qemu.conf
@@ -9965,17 +9965,14 @@ qemuProcessPrepareStorageSourceTLSVxhs(virStorageSourcePtr src,
  * Returns 0 on success, -1 on bad config/failure
  */
 static int
-qemuDomainPrepareDiskSourceTLS(virStorageSourcePtr src,
-                               virQEMUDriverConfigPtr cfg)
+qemuDomainPrepareStorageSourceTLS(virStorageSourcePtr src,
+                                  virQEMUDriverConfigPtr cfg)
 {
-    virStorageSourcePtr next;
 
-    for (next = src; virStorageSourceIsBacking(next); next = next->backingStore) {
-        if (next->type == VIR_STORAGE_TYPE_NETWORK &&
-            next->protocol == VIR_STORAGE_NET_PROTOCOL_VXHS &&
-            qemuProcessPrepareStorageSourceTLSVxhs(next, cfg) < 0)
-            return -1;
-    }
+    if (src->type == VIR_STORAGE_TYPE_NETWORK &&
+        src->protocol == VIR_STORAGE_NET_PROTOCOL_VXHS &&
+        qemuProcessPrepareStorageSourceTLSVxhs(src, cfg) < 0)
+        return -1;
 
     return 0;
 }
@@ -12504,7 +12501,7 @@ qemuDomainPrepareDiskSource(virDomainDiskDefPtr disk,
     if (qemuDomainPrepareDiskSourceLegacy(disk, priv, cfg) < 0)
         return -1;
 
-    if (qemuDomainPrepareDiskSourceTLS(disk->src, cfg) < 0)
+    if (qemuDomainPrepareStorageSourceTLS(disk->src, cfg) < 0)
         return -1;
 
     return 0;