Skip to content

Extend storage proposal D-Bus API#268

Merged
joseivanlopez merged 9 commits intomasterfrom
dbus_volumes
Nov 14, 2022
Merged

Extend storage proposal D-Bus API#268
joseivanlopez merged 9 commits intomasterfrom
dbus_volumes

Conversation

@ancorgs
Copy link
Contributor

@ancorgs ancorgs commented Oct 18, 2022

Problem

The D-Bus API for calculating a storage proposal is very limited. It only allows to select lvm and the candidate devices for the installation. The D-Bus API nees to provide more options to allow clients to configure the volumes to create.

Solution

The D-Bus API was extended and the backend classes adapted to support volume definitions.

Testing

  • Manually tested
  • Added unit tests

Examples


# Calculate a proposal without indicating volumes at all

$ busctl call org.opensuse.DInstaller.Storage /org/opensuse/DInstaller/Storage/Proposal1 org.opensuse.DInstaller.Storage.Proposal1 Calculate a{sv} 
1 CandidateDevices as 1 /dev/vdc
> u 0

$ busctl get-property org.opensuse.DInstaller.Storage /org/opensuse/DInstaller/Storage/Proposal1 org.opensuse.DInstaller.Storage.Proposal1 Volumes
> aa{sv} 2 
13 "MountPoint" s "/" "Optional" b false "DeviceType" s "partition" "Encrypted" b false "FsTypes" av 5 s "Ext2" s "Ext3" s "Ext4" s "Btrfs" s "XFS" "FsType" s "Btrfs"
"MinSize" x 18790481920 "MaxSize" i -1 "FixedSizeLimits" b false "AdaptiveSizes" b true "Snapshots" b true "SnapshotsConfigurable" b true "SnapshotsAffectSizes" b true
13 "MountPoint" s "swap" "Optional" b true "DeviceType" s "partition" "Encrypted" b false "FsTypes" av 1 s "Swap" "FsType" s "Swap"
"MinSize" i 1073741824 "MaxSize" x 2147483648 "FixedSizeLimits" b false "AdaptiveSizes" b false "Snapshots" b false "SnapshotsConfigurable" b false "SnapshotsAffectSizes" b false


# Calculate a proposal giving only some details about the volumes to create

$ busctl call org.opensuse.DInstaller.Storage /org/opensuse/DInstaller/Storage/Proposal1 org.opensuse.DInstaller.Storage.Proposal1 Calculate a{sv} 
2 CandidateDevices as 1 /dev/vdc Volumes aa{sv} 2 
2 MountPoint s /home MinSize u 1024 
2 MountPoint s / Snapshots b false 
> u 0

$ busctl get-property org.opensuse.DInstaller.Storage /org/opensuse/DInstaller/Storage/Proposal1 org.opensuse.DInstaller.Storage.Proposal1 Volumes
> aa{sv} 2
11 "MountPoint" s "/home" "Optional" b true "DeviceType" s "partition" "Encrypted" b false "MinSize" i 1024 "MaxSize" i -1 "FixedSizeLimits" b true "AdaptiveSizes" b false
"Snapshots" b false "SnapshotsConfigurable" b false "SnapshotsAffectSizes" b false
13 "MountPoint" s "/" "Optional" b false "DeviceType" s "partition" "Encrypted" b false "FsTypes" av 5 s "Ext2" s "Ext3" s "Ext4" s "Btrfs" s "XFS" "FsType" s "Btrfs"
"MinSize" x 5368709120 "MaxSize" i -1 "FixedSizeLimits" b false "AdaptiveSizes" b true "Snapshots" b false "SnapshotsConfigurable" b true "SnapshotsAffectSizes" b true

@coveralls
Copy link

coveralls commented Nov 11, 2022

Coverage Status

Coverage remained the same at 74.679% when pulling f367566 on dbus_volumes into 7e67366 on master.

@joseivanlopez joseivanlopez force-pushed the dbus_volumes branch 3 times, most recently from 6259125 to bad6896 Compare November 11, 2022 15:42
@joseivanlopez joseivanlopez changed the title WIP: improved API for storage Extend storage proposal D-Bus API Nov 11, 2022
@joseivanlopez joseivanlopez marked this pull request as ready for review November 11, 2022 16:06
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.

Great work! It looks like a powerful base to build the rest on top 💪🏻

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.

4 participants