Commit Graph

458 Commits

Author SHA1 Message Date
Andy Grover 3637171a68 update to 2.1.fb63
Signed-off-by: Andy Grover <agrover@redhat.com>
2017-03-01 13:30:29 -08:00
Andy Grover 304f183b1a Merge pull request #87 from apearson-ibm/master
Add ability to invalidate caches
2017-02-07 11:13:46 -08:00
Amartey Pearson e54d50d732 Add ability to invalidate caches
For efficiency, rtslib may have caches (today for the data
in configfs).  A client may need to clear out these caches
such as via the refresh option in targetcli.

* Add new invalidate_caches method to RTSRoot.  While this only
has a single cache today, it gives the ability to extend to
any future caches.
* While bs_cache really should be private, it probably
shouldn't be changed given that this is a library and may be
used elsewhere.

Signed-off-by: Amartey Pearson <apearson@us.ibm.com>
2017-02-07 12:38:33 -06:00
Andy Grover 2c65d971ab Merge pull request #89 from mikechristie/alua-exception
Fix crash during restore due to ALUA exception
2017-02-07 09:09:20 -08:00
Mike Christie 13dfb1aadb Don't raise exception when getting/setting a LUNs ALUA group
Fix crash due to trying to get/set the ALUA group on
passthrough backends. Instead of raising an exception
return None/-1 on failure.

Signed-off-by: Mike Christie <mchristi@redhat.com>
2017-02-06 17:55:29 -06:00
Mike Christie 6bd910bd55 Add ALUA supported method
Passthrough backends like pscsi and user do not support ALUA
managment through configfs. You can create groups, but writing
to files can cause the kernel crashes.

This adds a alua_supported method that backends can override
and return False to indicate they do not support ALUA.

Signed-off-by: Mike Christie <mchristi@redhat.com>
2017-02-06 17:54:57 -06:00
Amartey Pearson 6453b0d484 Add ability to invalidate caches
For efficiency, rtslib may have caches (today for the data
in configfs).  A client may need to clear out these caches
such as via the refresh option in targetcli.

* Add new invalidate_caches method to RTSRoot.  While this only
has a single cache today, it gives the ability to extend to
any future caches.
* While bs_cache really should be private, it probably
shouldn't be changed given that this is a library and may be
used elsewhere.

Signed-off-by: Amartey Pearson <apearson@us.ibm.com>
2017-01-23 11:27:28 -06:00
Andy Grover 572e9b41ba Merge pull request #86 from mikechristie/alua-fixes
Do not set alua_tg_pt_gp if not supported
2017-01-19 16:41:11 -08:00
Mike Christie 59f3fc4659 Do not set alua_tg_pt_gp if not supported
Pass through backends do not support alua_tg_pt_gp and writing to
the file will hang the system. Trying to read from them will
cause a rtslib crash because they are empty. This patch fixes
both issues by detecting the empty file and failing writes.
2017-01-11 16:32:18 -06:00
Andy Grover 19efee2bc7 version 2.1.fb62
Signed-off-by: Andy Grover <agrover@redhat.com>
2017-01-04 10:44:31 -08:00
Andy Grover ba18560bee Merge pull request #84 from mikechristie/alua
ALUA support for rtslib-fb
2017-01-04 10:30:12 -08:00
Mike Christie 163ee01124 Delete ALUA groups with its storage object
We must delete the ALUA groups under the storage object
when deleting the storage object.

Signed-off-by: Mike Christie <mchristi@redhat.com>
2017-01-03 13:56:28 -06:00
Mike Christie b85519f44b Add ALUA restore support
Add support to save ALUA info and restore it.

Signed-off-by: Mike Christie <mchristi@redhat.com>
2017-01-03 13:56:28 -06:00
Mike Christie 1f3abc3cad Get/Set LUN's ALUA group
Add support to Get/Set a Lun's current ALUA group through
its alua_tg_pt_gp file.

Signed-off-by: Mike Christie <mchristi@redhat.com>
2017-01-03 13:56:28 -06:00
Mike Christie 39aba4c939 Add basic ALUA support
This patch adds support for creating ALUA groups for storage objects
and setting up their state.

The next patch will add support to map these groups to LUNs.

This patchset does not add support for LU groups and secondary
groups.

Signed-off-by: Mike Christie <mchristi@redhat.com>
2017-01-03 13:56:28 -06:00
Andy Grover 7acc1e73f2 Merge pull request #82 from seroyer/master
Add IBM PowerVM vscsi fabric
2016-11-09 11:31:04 -08:00
Steven Royer 76b3acea16 Add IBM PowerVM vscsi fabric
Adds support for the IBM PowerVM virtual SCSI fabric.  This uses the
ibmvscsis kernel module that merged in 4.8 and later kernels.

Signed-off-by: Steven Royer <seroyer@us.ibm.com>
2016-11-09 13:09:22 -06:00
Andy Grover 6b185eedf9 Merge pull request #81 from dirkmueller/master
Depend on pyudev during runtime
2016-11-03 17:17:53 -07:00
Dirk Mueller 925281b9f0 Depend on pyudev during runtime
In v2.1.fb60 an unconditional dependency to pyudev was added,
which needs to be specified in the egg info, otherwise pip install might fail with e.g.

File "local/lib/python2.7/site-packages/rtslib/utils.py", line 30, in <module>
     import pyudev
 ImportError: No module named pyudev
2016-11-03 22:35:29 +01:00
Andy Grover 1c2730e991 Merge pull request #79 from cvubrugier/master
Add Gentoo to the list of distributions that ship rtslib-fb
2016-10-28 09:40:56 -07:00
Christophe Vu-Brugier d420b805b1 Add Gentoo to the list of distributions that ship rtslib-fb
Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
2016-10-28 14:53:33 +02:00
Andy Grover 0ffeb3b75e Merge pull request #78 from cvubrugier/remove-packaging
Remove build scripts for RPM and Debian packages
2016-10-27 11:28:09 -07:00
Christophe Vu-Brugier b3f692f60b Remove build scripts for RPM and Debian packages
Remove the "example-debian" and "example-rpm" directories because our
in-repo packaging is less complete than the packaging made by
distributions.

Finally, this patch adds a few links to RPM and Debian build scripts in
our README.md.

Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
2016-10-24 20:22:54 +02:00
Andy Grover d7ccfcf592 version 2.1.fb61
Signed-off-by: Andy Grover <agrover@redhat.com>
2016-10-03 10:58:42 -07:00
Andy Grover e04d87b5f8 Implement support for cxgbit offload
Just like the 'iser' value within np/, save and restore the 'cxgbit' value.
However, the property is called 'offload'. This will let us handle other
offloads with the same property in the future if and when they are
supported.

Signed-off-by: Andy Grover <agrover@redhat.com>
2016-10-03 10:54:33 -07:00
Andy Grover cb7f5ee9c0 Merge pull request #77 from cvubrugier/master
Change the URL of the GitHub repo to the open-iscsi organization
2016-08-22 10:52:35 -07:00
Christophe Vu-Brugier 3d47f83211 Change the URL of the GitHub repo to the open-iscsi organization
Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
2016-08-22 16:23:45 +02:00
Andy Grover ba87a191ed Rework convert_scsi_path_to_hctl and convert_scsi_hctl_to_path
Do not check for type=disk, this is not a requirement.

Raise an RTSLibError if not found, rather than returning None.

Rework PSCSIStorageObject._configure to use the new semantics, and avoid
else clauses in try blocks, since they are confusing and not strictly
needed.

Properly qualify DeviceNotFoundError as pyudev.DeviceNotFoundError.

Signed-off-by: Andy Grover <agrover@redhat.com>
2016-08-12 10:19:14 -07:00
Andy Grover 8277306b4d Handle if LIO components are compiled in the kernel
Attempt to do the thing that would require the module first, and if it
fails then attempt to load the module and retry. This should handle all
combinations of modules, compiled-in etc. and return an error if a needed
component is neither compiled in or as a module.

Fixes #64

Signed-off-by: Andy Grover <agrover@redhat.com>
2016-08-11 10:26:20 -07:00
Andy Grover f2046d721d Merge pull request #76 from jaredeh/for_upstream
fixes to debian package scripts
2016-06-22 09:35:43 -07:00
Jared Hulbert 95754007b2 fixes to debian package scripts 2016-06-21 16:02:14 -07:00
Andy Grover dda8dc71b5 Merge pull request #75 from Gandem/master
Changed example-debian folder for compatibility with dpkg-buildpackage
2016-06-13 15:59:57 -07:00
Nayef Ghattas cf92f069fe Changed example-debian folder for compatibility with dpkg-buildpackage 2016-06-13 23:19:22 +02:00
Andy Grover a2f4165010 Merge pull request #73 from colml/race-mount
On systems where loading the configfs module (modprobe configfs) automatically mounts /sys/kernel/config, a race condition can occur in the mount_configfs() function in utils.py.

As that function is called immediately after the modprode function, the os.path.ismount check can be called before configfs is finished mounting. The mount command is then run but fails because the mount is busy as it's mounted.

One possible workaround is to make a second os.path.ismount check if the mount command fails, and if it is mounted then we don't raise an exception.
if process.returncode != 0 and not os.path.ismount("/sys/kernel/config"):
raise RTSLibError("Cannot mount configfs")
2016-06-03 09:43:08 -07:00
colml 9134f76aab Fix mount race condition 2016-06-03 09:32:47 +01:00
Andy Grover c58895226e convert-to-json: Fix to handle fileio and other issues
parse_fileio was a cut-n-paste from block, missing key attributes like
size and buffered. Fixed.

Also, bodge up better handling for single vs multiple tpgs. Clarify
referring to tpgs versus the tpg tag (tpgt, an integer).

Signed-off-by: Andy Grover <agrover@redhat.com>
2016-05-12 11:09:49 -07:00
Andy Grover ebf20306d6 Initial version of convert-to-json script
This script attempts to convert from Datera 3.0's scsi_target.lio format
to rtslib-fb's json format. It currently is not fully parsing the .lio
file according to its grammar, it's kind of ad-hoc, shall we say, so that
it hopefully works on most existing .lio files.

Signed-off-by: Andy Grover <agrover@redhat.com>
2016-05-10 20:53:10 -07:00
Andy Grover 5061cf0c71 version 2.1.fb60
Signed-off-by: Andy Grover <agrover@redhat.com>
2016-04-07 17:34:18 -07:00
Andy Grover 7576593de7 Fix 'make rpm'
Include symlinks in dist tarball

fix some paths in specfile.

Signed-off-by: Andy Grover <agrover@redhat.com>
2016-03-25 16:28:30 -07:00
Andy Grover 845606a282 Merge pull request #71 from famz/UserBackedStorageObject-__init__-docstring
UserBackedStorageObject: Fix docstring for __init__
2016-03-15 10:02:45 -07:00
Fam Zheng 2372b244d5 UserBackedStorageObject: Fix docstring for __init__
The present parameter list is "name, config, size, wwn", update the
docstring to match this.

Signed-off-by: Fam Zheng <famz@redhat.com>
2016-03-15 14:00:26 +08:00
Andy Grover 2b12785245 Merge pull request #70 from jmagrini/origin
Ensure internal buffers are flushed when saveconfig.json …
2016-01-19 08:15:18 -08:00
Jon Magrini b625f61a03 [rtslib-fb] Ensure internal buffers are flushed when saveconfig.json is written to disk. A power-outage, unexpected reboot, etc
can lead to zero byte file after a saveconfig.

Signed-off-by: Jon Magrini <jmagrini@redhat.com>
2016-01-19 09:36:51 -05:00
Andy Grover 903b61005f Merge pull request #69 from mulkieran/master-pyudev-fix2
Make sure to properly avoid treating partitions the same as disk.
2016-01-11 14:58:38 -08:00
mulhern 2393c1fd4f Make sure to properly avoid treating partitions the same as disk.
Return None if device path is a partition in convert_scsi_path_to_hctl.

In convert_scsi_hctl_to_path ensure that device is not a partition in the
most correct and efficient way. Get exactly the set of devices that are
descendants of the scsi device and are block devices and have type disk.
This should be a singleton, or the empty set.

Signed-off-by: mulhern <amulhern@redhat.com>
2016-01-11 13:15:52 -05:00
Andy Grover 598af739d2 Merge pull request #68 from mulkieran/master-pyudev-fix
Use find_parent instead of parent.
2016-01-08 15:12:56 -08:00
mulhern c4d2666955 Use find_parent instead of parent.
Better, because it is sure to find the scsi parent.
You never know what intermediate parent might get interposed.

Better, becaus it does not rely on subsystem property
(which sometimes raises an AttributeError (fixed in pyudev 0.19)).

Signed-off-by: mulhern <amulhern@redhat.com>
2016-01-08 15:48:35 -05:00
Andy Grover f17b77d47d Update README.md again
Gaah, grammar.
2015-12-18 18:37:30 -08:00
Andy Grover 501521813c Update README.md
We no longer use 2to3.
2015-12-18 18:36:25 -08:00
Andy Grover d2de7ae9d9 Merge pull request #67 from mulkieran/master-pyudev-maybe
Make use of pyudev package as much as possible in utils module.
2015-12-11 10:59:34 -08:00