example.spec: spell fix

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andy Grover <agrover@redhat.com>
gitignore: remove *.spec it

it blacklists basically everything in spec/

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andy Grover <agrover@redhat.com>
add spec for the usb_gadget

|root@squsb:~# mount a -t configfs /sys/kernel/config
|root@squsb:~# modprobe dummy_hcd
|root@squsb:~# targetcli
|Welcome to the targetcli shell:
|
| Copyright (c) 2011 by RisingTide Systems LLC.
|
|Visit us at http://www.risingtidesystems.com.
|
|Can't load fabric module qla2xxx.
|Can't load fabric module ib_srpt.
|Loaded iscsi_target_mod kernel module.
|Created '/sys/kernel/config/target/iscsi'.
|Done loading iscsi fabric module.
|Created '/sys/kernel/config/target/loopback'.
|Done loading loopback fabric module.
|Can't load fabric module tcm_fc.
|Created '/sys/kernel/config/target/usb_gadget'.
|Done loading usb_gadget fabric module.
|
|/backstores/rd_mcp> create disk 256M
|Generating a wwn serial.
|Created rd_mcp ramdisk disk with size 256M.
|Entering new node /backstores/rd_mcp/disk
|
|/usb_gadget> create
|Created target naa.60014052d9f751dd.
|Entering new node /usb_gadget/naa.60014052d9f751dd
|/usb_gadget/n...14052d9f751dd> cd luns
|/usb_gadget/n...d9f751dd/luns> create /backstores/rd_mcp/disk
|Selected LUN 0.
|Successfully created LUN 0.
|Entering new node /usb_gadget/naa.60014052d9f751dd/luns/lun0
|/usb_gadget/n...1dd/luns/lun0>
|/usb_gadget/n...1dd/luns/lun0> cd ..
|/usb_gadget/n...d9f751dd/luns> cd ..
|/usb_gadget/n...14052d9f751dd> disable
|The TPGT has been disabled.
|/usb_gadget/n...14052d9f751dd> enable
|The TPGT has been enabled.

after that on the host side:

|[  227.097768] usb 1-1: configuration #1 chosen from 1 choice
|[  227.100157]  gadget: high-speed config #1: Linux Target
|[  227.102934] Using the BOT protocol
|[  227.115756] Using the UAS protocol
|[  227.121483] scsi1 : uas
|[  227.128314] scsi 1:0:0:0: Direct-Access     LIO-ORG  RAMDISK-MCP      4.0  PQ: 0 ANSI: 5 TAG: 1
|[  227.164322] sd 1:0:0:0: [sda] 524288 512-byte logical blocks: (268 MB/256 MiB)
|[  227.204283] sd 1:0:0:0: [sda] Write Protect is off
|[  227.204904] sd 1:0:0:0: [sda] Mode Sense: 2f 00 00 00
|[  227.220285] sd 1:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
|[  227.300319]  sda: unknown partition table
|[  227.376286] sd 1:0:0:0: [sda] Attached SCSI disk

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andy Grover <agrover@redhat.com>
Edits to session support

NodeAcl.session returns either an initialized Session or None, instead of
an empty Session object.

Make Session.parent_nodeacl not private

Add Session.exists to reflect if session info is actually present in cfs

Simplify info parsing a little, have Connection init take required params.

Signed-off-by: Andy Grover <agrover@redhat.com>
Add root.sessions property

Generator that yields Sessions.

closes #10

Signed-off-by: Andy Grover <agrover@redhat.com>
sessions: document public variables; None for defaults

Instance variables without docstrings won't show up at all with epydoc.

Should be consistent with None vs. "" as default here.

Signed-off-by: Johannes Dewender <github@JonnyJD.net>
Merge pull request #13 from JonnyJD/sessions

sessions: document public variables; None for defaults
Refactor nodeacl._get_session to use dicts instead of classes

I watched this video last night:

http://pyvideo.org/video/880/stop-writing-classes

and I think it's on point, we can simplify how we're returning session
info to use dicts/lists instead of classes.

Signed-off-by: Andy Grover <agrover@redhat.com>
Remove no-longer-applicable epydoc tag

Signed-off-by: Andy Grover <agrover@redhat.com>
Update ib_srpt.spec for proper usage with ib_srpt

see http://permalink.gmane.org/gmane.linux.scsi.target.devel/1513

Reported-by: Marcus Sorensen <shadowsor@gmail.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
allow saving configuration parameters and enable state.

Signed-off-by: Rafiu Fakunle <rafiu@openfiler.com>
Signed-off-by: António Meireles <antonio.meireles@openfiler.com>
Merge pull request #14 from openfiler/8a14bc5439b5b41bd0d0884ee3d5de5e9693f26d

allow saving config params and enable state.
Update ib_srpt.spec:wwn_from_files_filter formatting

Update ib_srpt.spec usage for mainline /sys/kernel/config/target/srpt/$SRPT_WWPN
formatting to use the GUID '0xfe00' prefix instead of the original '0x0000'.

http://permalink.gmane.org/gmane.linux.scsi.target.devel/1513

Reported-by: Marcus Sorensen <shadowsor@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
Merge upstream changes
Fix NodeACL dump() for non-iscsi fabrics

tcq_depth is iscsi=specific, remove.

reading chap auth values will fail for non-iscsi fabrics.

Signed-off-by: Andy Grover <agrover@redhat.com>
Merge branch 'master' into dev

Signed-off-by: Andy Grover <agrover@redhat.com>
Revert "Added generic auth attributes support in CFSNode"

This reverts commit f67065e5fb73fdf80b59534ff3eb1243e63c4c64.

Revert "Do not append newline when setting auth attribute"

This reverts commit 54668c1a21a9a839143fec98376b762fab4f0873.

Going to hold off on this change for the moment, not clear on the value.

Signed-off-by: Andy Grover <agrover@redhat.com>
Remove human/bytes conversion functions

These are UI-related and should be in the UI code. Moved to targetcli.

Signed-off-by: Andy Grover <agrover@redhat.com>
Raise RTSLibError if trying to create invalid entry in configfs

rtslib is designed to only throw RTSLib-defined exceptions. Since
the mkdir can fail, wrap it in a try block and convert any errors to
rtsliberrors.

This should fix https://bugzilla.redhat.com/show_bug.cgi?id=830672

Signed-off-by: Andy Grover <agrover@redhat.com>
Remove alua_metadata_path from LUN and TPG

alua_metadata_path is a separate location in the filesystem for storing
alua metadata. We don't use this. When we implement saving alua metadata
we should use dump() like everything else.

Signed-off-by: Andy Grover <agrover@redhat.com>