[REPOST 4/8] scsi_backend: Use existing LINUX_SYSFS_SCSI_HOST_PREFIX definition

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

 



Rather than supplying the path again in the formatting of the sysfs
scsi_host directory.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/storage/storage_backend_scsi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
index b5dbe51..e42778f 100644
--- a/src/storage/storage_backend_scsi.c
+++ b/src/storage/storage_backend_scsi.c
@@ -475,7 +475,8 @@ virStorageBackendSCSITriggerRescan(uint32_t host)
 
     VIR_DEBUG("Triggering rescan of host %d", host);
 
-    if (virAsprintf(&path, "/sys/class/scsi_host/host%u/scan", host) < 0) {
+    if (virAsprintf(&path, "%s/host%u/scan",
+                    LINUX_SYSFS_SCSI_HOST_PREFIX, host) < 0) {
         retval = -1;
         goto out;
     }
@@ -663,7 +664,8 @@ virStorageBackendSCSICheckPool(virConnectPtr conn ATTRIBUTE_UNUSED,
     if (getHostNumber(name, &host) < 0)
         goto cleanup;
 
-    if (virAsprintf(&path, "/sys/class/scsi_host/host%d", host) < 0)
+    if (virAsprintf(&path, "%s/host%d",
+                    LINUX_SYSFS_SCSI_HOST_PREFIX, host) < 0)
         goto cleanup;
 
     *isActive = virFileExists(path);
-- 
1.9.3

--
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]