[PATCH 02/38] qemu: domain: Reuse code when preparing hostdev auth secrets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use qemuDomainSecretStorageSourcePrepare in
qemuDomainSecretHostdevPrepare as it uses a virStorageSource to prepare
the authentication secret object data.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 708d562e82..8a93223633 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1600,22 +1600,11 @@ qemuDomainSecretHostdevPrepare(qemuDomainObjPrivatePtr priv,
         virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi;
         virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &scsisrc->u.iscsi;
         virStorageSourcePtr src = iscsisrc->src;
-        qemuDomainStorageSourcePrivatePtr srcPriv;

         if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI &&
             src->auth) {
-
-            if (!(src->privateData = qemuDomainStorageSourcePrivateNew()))
-                return -1;
-
-            srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
-
-            if (!(srcPriv->secinfo =
-                  qemuDomainSecretInfoNew(priv, hostdev->info->alias,
-                                          VIR_SECRET_USAGE_TYPE_ISCSI,
-                                          src->auth->username,
-                                          &src->auth->seclookupdef,
-                                          false)))
+            if (qemuDomainSecretStorageSourcePrepare(priv, src,
+                                                     hostdev->info->alias, NULL) < 0)
                 return -1;
         }
     }
-- 
2.16.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux