open-iscsi / rtslib-fb

Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO)
Apache License 2.0
72 stars 90 forks source link

create: remove stale hba-only dir #118

Closed pkalever closed 6 years ago

pkalever commented 6 years ago

curretly if there exist any stale hba-only directories,

$ ls /sys/kernel/config/target/core/user_0/ hba_info hba_mode

Then backend creation fails,

$ targetcli /backstores/fileio create block file 1M This _Backstore already exists in configFS

We will have to restart target.service or restore the configuration again to clear the stale hba-only dirs.

This patch checks for hba directory before creating one, if it is already existing and found to be stale then removes it.

Thanks to "Maurizio Lombardi mlombard@redhat.com" for debugging along

Signed-off-by: Prasanna Kumar Kalever prasanna.kalever@redhat.com

pkalever commented 6 years ago

review-request: @maurizio-lombardi @agrover

pkalever commented 6 years ago

@agrover I have made the changes as per your suggestions. Thanks!