-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
D-Bus API for iSCSI #402
D-Bus API for iSCSI #402
Conversation
282f62f
to
3683b9e
Compare
0912902
to
6dbe4c3
Compare
Not directly applicable right now, but eventually I hope: |
d9b2576
to
7e1739b
Compare
In the review somebody mentioned that service/lib/dinstaller/dbus/storage/manager.rb was getting quite big, with all the interfaces it needs to have. One way to address it would be to put each of the interfaces in its own Module... and we're already doing it with Perhaps doing the same for all the remaining interfaces would solve the problem? Or split the manager object up according to the responsibilities? If ruby-dbus can get an improvement to help with it, I'd happily add it, but so far I don't see one. |
The problem I see is that the interface properties and methods are defined by the dbus object. If a dbus object implements quite some ifaces, then it has to define all the methods for each intereface, which implies to have a dbus object with a lot of possibly unrelated logic. Moreover, we need to pay special attention to property/method name collition, specially when importing interfaces from a module (e.g., I would like to have some kind of composition or similar approach for aisolating the interface logic and definition. An idea could be to do something similar to what a service does with exporting D-Bus objects. For example, interfces are defined in its own class, and then the D-Bus object add them: class MyObject < DBus::Object
def initialize
foo_iface = DBus::Interface.new
bar_iface = DBus::Interface.new
add_interfaces foo_iface, bar_iface
end
end We could workaround it by implementing some kind of And maybe, it would also open the door to dynamically removing interfaces in the future: |
But that problem is also true if we leave out D-Bus out of the picture, and then it looks to me like an ordinary OOP design problem: mixing too many responsibilities in a single class. I would solve that by using different classes/objects. Here, the ISCSI.Initiator interface is IMHO a natural case for one. Even if the objects lifetimes are tightly coupled (so you could take that a reason to combine them in a single class) I'd split them up for clarity and ease of maintenance. |
108becb
to
4e30417
Compare
0db7ff7
to
db408a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just releasing some comments (I did hit the wrong button when adding them).
f1b8800
to
bc732ff
Compare
b5c3865
to
5fb93b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally it looks pretty nice. Great work. But I added a couple of comments.
b7888d6
to
b802a6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great work!
https://build.opensuse.org/request/show/1073333 by user IGonzalezSosa + dimstar_suse - Version 0.8 * Adapted the service configuration for the s390x architecture (gh#agama-project/agama#469). * Fix gem2rpm configuration requiring the dbus-1-common package (gh#agama-project/agama#470). * Fix gem2rpm configuration to include YaST2 dependencies (gh#agama-project/agama#459). * Write /iguana/mountlist if running on Iguana (gh#agama-project/agama#445). * Add D-Bus API for iSCSI (gh#agama-project/agama#402).
Problem
D-Installer does not provide a way of connecting to iSCSI targets yet.
https://trello.com/c/iQ7BCexU/3261-5-d-installer-d-bus-interface-configure-the-iscsi-initiator-and-the-iscsi-targets
Solution
Extend current D-Bus API of the storage service in order to support iSCSI.
Now the main object
/DInstaller/Storage1
implements a new interface.DInstaller.Storage1.ISCSI.Initiator
. That interface offers methods for configuring the iSCSI initiator, performing discovey, and deleting node.Discovered nodes are dynamically exported in the path
/DInstaller/Storage1/iscsi_nodes/[0-9]+
, and such nodes implements the interface.DInstaller.Storage1.ISCSI.Node
. A node allows to login and logout.Follow-up:
Examples
Configure iSCSI initiator name:
Perform discovery
Login
Logut
Delete
Testing
Screenshots