]> xenbits.xensource.com Git - libvirt.git/commitdiff
scsi_backend: Use existing LINUX_SYSFS_SCSI_HOST_PREFIX definition
authorJohn Ferlan <jferlan@redhat.com>
Mon, 9 Jun 2014 16:41:04 +0000 (12:41 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 21 Jul 2014 16:55:10 +0000 (12:55 -0400)
Rather than supplying the path again in the formatting of the sysfs
scsi_host directory.

src/storage/storage_backend_scsi.c

index f787c56861c46664973321647c20f8a76918df41..cbf8ccc0cd94172cfae09a98ab7a1aed80e0912f 100644 (file)
@@ -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);