Git Product home page Git Product logo

Comments (5)

JonnyJD avatar JonnyJD commented on July 20, 2024

I opted to implement the Session and Connection classes as Snapshots. So the information is parsed on creation and never parsed again for this object. This seemed like the natural way, since session information is volatile. Additionally, it wouldn't make sense to only to update certain attributes of the session, since you have to parse info whole anyways.

The session property of NodeACL is recreated on every access.

Also note, that Session and Connection don't inherite from CFSNode, because they are no cfs nodes.

from rtslib-fb.

JonnyJD avatar JonnyJD commented on July 20, 2024

For reference:

info with no open session:

No active iSCSI Session for Initiator Endpoint: iqn.2005-03.org.open-iscsi:xxx

With an open session (1 local connection):

InitiatorName: iqn.2005-03.org.open-iscsi:xxx
InitiatorAlias: test-host
LIO Session ID: 2   ISID: 0x00 02 3d 11 00 00  TSIH: 2  SessionType: Normal
Session State: TARG_SESS_STATE_LOGGED_IN
---------------------[iSCSI Session Values]-----------------------
  CmdSN/WR  :  CmdSN/WC  :  ExpCmdSN  :  MaxCmdSN  :     ITT    :     TTT
 0x00000010   0x00000010   0x000000d6   0x000000e5   0x2e000000   0x00001e8d
----------------------[iSCSI Connections]-------------------------
CID: 0  Connection State: TARG_CONN_STATE_LOGGED_IN
   Address 127.0.0.1 TCP  StatSN: 0xee10583f

from rtslib-fb.

JonnyJD avatar JonnyJD commented on July 20, 2024

Okay, that should do it. Please review.
If you don't see any problems with this solution, I will merge (--no-ff) it to master.

We could possibly implement FabricModule/Target/TPG to having a list (or generator with yield) of open sessions each. That is basically the same as with has_session, but doesn't stop when just one is found and throws no information away.
This highly depends on how we would display status information. If we don't need it, it might also be "clutter" in the API.

Technically also has_sessions is not a must-have and can be implemented in targetcli. After all you could list all kinds of things on all kinds of levels and also check for these on different levels. We have to implement this in targetlci then.

So if you say has_sessions doesn't belong in rtslib, I can also just merge 5e88ec2 (classes and .session in NodeACL) for now.

from rtslib-fb.

JonnyJD avatar JonnyJD commented on July 20, 2024

I updated my targetstatus prototype as a usage example of the new rtslib session API.

from rtslib-fb.

JonnyJD avatar JonnyJD commented on July 20, 2024

See #12 for the corresponding pull request.

from rtslib-fb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.