scsi_backend: Use existing LINUX_SYSFS_SCSI_HOST_PREFIX definition

Rather than supplying the path again in the formatting of the sysfs
scsi_host directory.
This commit is contained in:
John Ferlan 2014-06-09 12:41:04 -04:00
parent a4bd62adc1
commit aa9dac09b3
1 changed files with 4 additions and 2 deletions

View 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);