Skip to content

Instantly share code, notes, and snippets.

@ancorgs
Last active March 14, 2023 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ancorgs/390b064373995595a1b1dfb08d00507a to your computer and use it in GitHub Desktop.
Save ancorgs/390b064373995595a1b1dfb08d00507a to your computer and use it in GitHub Desktop.
dasd-signals.md

I'm designing the D-Bus signals for DASD formatting.

They are based on the information provided by a Y2S390::FormatProcess object which provides:

  • Y2S390::FormatProcess#status exit code of the format process if it finished, nil otherwise
  • Y2S390::FormatProcess#running? Obvious
  • Y2S390::FormatProcess#summary Status of all the DASDs requested to format
  • Y2S390::FormatProcess#update_summary Triggers an update of #summary and also updates #updated (see below)
  • Y2S390::FormatProcess#updated Subset of #summary with the entries that were modified by the latest call to #update_summary

First question: Only one signal like (a) or better two like (b)

(a)

dbus_signal :DasdFormatProgress, "finished:b, exit_code:u, progress:aa{s(uub)}"

(b)

dbus_signal :DasdFormatFinished, "exit_code:u"
dbus_signal :DasdFormatProgress, "progress:aa{s(uub)}"

Second question. Should the progress argument be based on Y2S390::FormatProcess#summary or on Y2S390::FormatProcess#updated?

@joseivanlopez
Copy link

joseivanlopez commented Mar 14, 2023

This progress concept is quite different to the progress we already have for the services. For this DASD formatting, maybe we can consider to have an specific interface:

dbus_interface "org.opensuse.DInstaller.Storage1.DASD.Formatter" do
  dbus_method(:Format, "in devices:ao, out result:u")
  dbus_reader(:running, "b")
  dbus_reader(:summary, "aa{s(uub)}")
  dbus_signal(:Finished, "exit_code:u")
  dbus_signal(:Updated, "data:aa{s(uub)}")
end

@joseivanlopez
Copy link

joseivanlopez commented Mar 14, 2023

And for having more than one format process, we could export an object for each process:

dbus_interface "org.opensuse.DInstaller.Storage1.DASD.Manager" do
  dbus_method(:Format, "in devices:ao, out result:u")
end

/org/opensuse/DInstaller/Storage1/processes/1
  org.opensuse.DInstaller.Storage1.Process
  org.opensuse.DInstaller.Storage1.DASD.Format

dbus_interface "org.opensuse.DInstaller.Storage1.Process" do
  dbus_reader(:running, "b")
  dbus_reader(:exit_code, "u")
end

dbus_interface "org.opensuse.DInstaller.Storage1.DASD.Format" do
  dbus_reader(:dasds, "ao")
  dbus_reader(:summary, "aa{s(uub)}")
  dbus_signal(:Updated, "data:aa{s(uub)}")
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment