Skip to content

Storage D-Bus reorganization#412

Merged
joseivanlopez merged 14 commits intoagama-project:masterfrom
joseivanlopez:storage-dbus-reorganization
Jan 26, 2023
Merged

Storage D-Bus reorganization#412
joseivanlopez merged 14 commits intoagama-project:masterfrom
joseivanlopez:storage-dbus-reorganization

Conversation

@joseivanlopez
Copy link
Contributor

@joseivanlopez joseivanlopez commented Jan 25, 2023

Problem

The storage D-Bus API is going to be extended in order to offer iSCSI iniciator support for discovering targets and logging. While researching about how to define the iSCSI API, we found some flaws in the current organization of the storage D-Bus API:

  • The proposal object (/DInstaller/Storage/Proposal1) has too many responsabilites: a) it provides neccesary info for calculating a proposal (e.g., available devices), b) calculates a new proposal, and c) provides info about the result.
  • The storage service status is managed by two different objects: /DInstaller/Storage1 and /DInstaller/Storage/Proposal1.
  • D-Bus API versioning is wrong.

Those issues should be fixed before extending the API with iSCSI support.

Part of https://trello.com/c/iQ7BCexU/3261-5-d-installer-d-bus-interface-configure-the-iscsi-initiator-and-the-iscsi-targets.

Solution

The storage D-Bus API was re-organized to fix some of the dectected issues.

The API was structured in the following way:

/DInstaller/Storage1
  .DInstaller.Storage1
  .DInstaller1.ServiceStatus
  .DInstaller1.Progress
  .DInstaller1.Validation
/DInstaller/Storage1/Proposal
  .DInstaller.Storage1.Proposal

And now the new API organization is:

/DInstaller/Storage1
  .ObjectManager
  .DInstaller.ServiceStatus1
  .DInstaller.Progress1
  .DInstaller.Validation1
  .DInstaller.Storage1
  .DInstaller.Storage1.Proposal.Calculator
    #Calculate
    #Result -> o
    #VolumeTemplates 
    #AvailableDevices
/DInstaller/Storage1/Proposal
  .DInstaller.Storage1.Proposal
    #LVM
    #EncryptionPassword
    #CandidateDevices
    #Volumes 
    #Actions

The main changes are:

  • Object /DInstaller/Storage1 implements a new iface .DInstaller.Storage1.Proposal.Calculator. That iface offers an API with all the methods/properties for calculating a proposal (available devices, volume templates, etc).
  • Object /DInstaller/Storage1/Proposal will be dynamic, and it will be present in the object tree only if a proposal was calculated (successful or not). For example, during the startup phase there is no proposal yet.
  • Objects and interfaces versioning is fixed.

Bonus: some refactoring was done for questions service, removing unnecessary code.

More improvements will come in the future to address these issues:

Testing

  • Added new unit tests
  • Tested manually

@joseivanlopez joseivanlopez force-pushed the storage-dbus-reorganization branch from 34bfc17 to 86e2ed8 Compare January 25, 2023 15:44
@joseivanlopez joseivanlopez force-pushed the storage-dbus-reorganization branch from 005e143 to 0dfd914 Compare January 25, 2023 17:11
@coveralls
Copy link

coveralls commented Jan 25, 2023

Coverage Status

Coverage: 76.714% (+1.0%) from 75.758% when pulling 4af0d5d on joseivanlopez:storage-dbus-reorganization into 92c9d90 on yast:master.

@joseivanlopez joseivanlopez marked this pull request as ready for review January 26, 2023 11:05
Copy link
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment (about the logger params). Otherwise, it looks good to me. Thanks a lot!

@joseivanlopez joseivanlopez force-pushed the storage-dbus-reorganization branch from e60a8b9 to 4af0d5d Compare January 26, 2023 15:33
@joseivanlopez joseivanlopez merged commit a28b018 into agama-project:master Jan 26, 2023
@imobachgs imobachgs mentioned this pull request Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants