| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Instead of just saying there was an error, also include the string text
from the RTSLibError exception.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
| |
Added for completeness.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|\
| |
| | |
Add a walkthrough for rtslib use
|
|/
|
|
|
|
| |
Add a walkthrough that demonstrates how to get started using rtslib.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
| |
NetworkPortal and LUN both missing '>'s at the end.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
| |
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
| |
Convert all incoming WWNs to lowercase for comparison.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
from_fabric_wwn and wwns() do two slightly different things, and it's
better if we keep them separate. from/to_fabric_wwn() convert our
canonical wwn format from/to the format the fabric in configfs expects.
wwns() reads from somewhere else to get a list of wwns. The format of
WWNs may not be the same as what the fabric uses, and it should convert
whatever it reads to canonical format without referencing what the
fabric's WWN format is.
I really hope this is the last ever commit on this stupid cesspool of
my own making.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Add comment for from_fabric_wwn to attempt to explain where all the
issues are coming from.
from_fabric_wwn is to convert tcm_fc wwn format to canonical. What's in
/sys/class/fc_host/.. is a different format and should be converted
to canonical separately.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
|
| |
If we want to remove both : and -, then we can futz around with translate
or we can just call replace() twice.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
|
| |
255 is too low. rtslib should be ready if the kernel lun-per-tpg limit
is raised.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
The old cache code was effective for lookups, but each cache miss caused
the cache to be regenerated by reading the filesystem. This causes O(n^2)
creation times.
Now, only fetch the cache once, then keep bs_cache updated.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
| |
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|\
| |
| | |
For partitions, retrieve the logical block size of the parent device
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
Partitions have a sysfs "size" but no "logical_block_size".
As a consequence, we need to look at the parent device to
determine the physical block size of a partition.
This patch fixes an exception raised in `targetcli` when
partitions are listed under /backstores/block:
FileNotFoundError: [Errno 2] No such file or directory:
'/sys/block/sdb/sdb1/queue/logical_block_size'
Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
|
|
|
|
|
|
|
| |
For use from targetcli, we want to make restoring a config when there
already is a config require extra confirmation.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|\
| |
| | |
Replaced translate() with replace() to fix python 3.2 compatibility
|
| | |
|
|/
|
|
| |
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|\
| |
| | |
add rc script to debian package
|
| |
| |
| |
| | |
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
|
| |
| |
| |
| |
| |
| | |
The target rc script is replaced with the one in rtslib.
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
|
| |
| |
| |
| |
| |
| |
| | |
This was moved from targetcli to rtslib,
using targetctl.
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
|
|\ \
| | |
| | | |
Fix targetctl restore
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
That was the argument name in targetctl,
which isn't visible here.
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
|
| |/
| |
| |
| |
| |
| |
| | |
There is no clear_existing argument.
restore_from_file() always clears the config first.
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
|
|/
|
|
| |
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|\
| |
| | |
load configfs before mounting it
|
|/
|
|
| |
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
|
|
|
|
| |
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
| |
modprobing was moved over to fabric.py.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
| |
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
| |
Fixes #37.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The system service that restores target state may not always be configured
to run. If so, running targetcli may return strange error messages,
because it also is responsible for mounting configfs.
Instead, have rtslib try to mount configfs. If it's already mounted then
no problem, but this will ensure that using targetcli without the target
service activated will work, it just won't have the previous
configuration.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
| |
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Push down the ability to save/restore state to/from a file, from targetcli
to rtslib. This will let us coordinate access from multiple API users
(targetd, targetcli, targetctl) to ensure atomicity, and also make
targetcli an optional installed component if the user is not using it.
Modify targetctl to use the new APIs. Since various exceptions set return
status to 1, targetctl should still properly be setting nonzero exit
status so scripts can check it.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
| |
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
|
|
|
| |
It seems like this might be useful. If restore has errors, it will result
in a partially applied configuration. Maybe this what the user wants, or
maybe they'd just as soon have no configuration if any part of it fails.
If so, 'clear' to the rescue if exit status from 'restore' is nonzero.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
|
| |
Eliminates some duplicate code and has a better name. Still not using
configparser yet, hopefully we won't need it.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Targetcli is not scriptable. One way around this is to modify or create the
json describing the config directly, but even then, targetcli is needed to
save or restore the json file.
These new scripts enable saving or restoring a json-based configuration to
not rely on calling targetcli, or even being installed. These scripts and
just rtslib can properly return exit status & stderr output if
something goes wrong.
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|
|
|
|
|
| |
See discussion in https://github.com/agrover/configshell-fb/pull/8
Signed-off-by: Andy Grover <agrover@redhat.com>
|
|\
| |
| | |
update debian packaging
|
| |
| |
| |
| |
| |
| | |
This also splits a -docs package for both.
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
|
| |
| |
| |
| | |
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
|
| |
| |
| |
| |
| |
| |
| | |
We don't have any dependencies anymore.
Additionally, this conflicts with the original rtslib package.
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
|
| |
| |
| |
| | |
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
|
|/
|
|
| |
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
|
|\
| |
| | |
2to3: preparatory work for python 3
|
| |
| |
| |
| |
| |
| | |
Generated with `2to3 -f ws_comma`.
Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
|
| |
| |
| |
| |
| |
| | |
Generated with `2to3 -f set_literal`.
Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
|