mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
a4bd62adc1
commit
aa9dac09b3
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue