Skip to content
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

Implement StopUnit and flesh out Job object #106

Merged
merged 12 commits into from
Feb 2, 2023

Commits on Feb 2, 2023

  1. Manager: Change StartUnitOp to more generic JobSetup

    We want to use this code for all operations that create a job.
    Also, make it refcount to streamline some of the memory ownership
    tracking.
    
    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    33b737b View commit details
    Browse the repository at this point in the history
  2. Agent: Make StartUnitOp a reusable AgentJobOp

    All the operations that track a job like StartUnit can reuse this
    type. Also, make it refcounted to make the ownership handling
    clearer.
    
    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    3a212c3 View commit details
    Browse the repository at this point in the history
  3. Add StopUnit node method

    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    ae56af6 View commit details
    Browse the repository at this point in the history
  4. Node: Centralize checking of offline nodes in dbus implementation

    We use a filter that runs before the vtable functions and ensure
    that all Node operations always handle offline nodes in a central
    place. This simplifies the method implementations and makes sure
    we don't miss the check somewhere.
    
    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    89d9938 View commit details
    Browse the repository at this point in the history
  5. Add DEFINE_CLEANUP_FUNC to avoid repetitive work

    This is similar to _SD_DEFINE_POINTER_CLEANUP_FUNC and means we don't
    have to repeat all these identical cleanup functions.
    
    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    2d51f99 View commit details
    Browse the repository at this point in the history
  6. Agent API description: Update to current state

    The actual implementation of the job side in the agent ended
    up a bit different, as we don't need a real job object for the
    agent side. We just reuse the unique id of the public job object
    to hang everything off.
    
    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    6c5c6dd View commit details
    Browse the repository at this point in the history
  7. User unrefp(&ptr) in destructors

    Whereever we have `if(ptr) unref(ptr)` we now use unrefp(&ptr) which
    makes the code cleaner with less unneccesary indentation.
    
    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    989942a View commit details
    Browse the repository at this point in the history
  8. Remove the TODOs about handling queueing

    After implementing this I don't think we need to do any queueing
    on the manager side. We already pass the mode to the agent which
    will give it to systemd, which does the queueing. We just need
    to propagate the WAITING => RUNNING state change.
    
    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    6e4e0c3 View commit details
    Browse the repository at this point in the history
  9. Node: Add comment for where ListUnits implementation begins.

    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    fff8214 View commit details
    Browse the repository at this point in the history
  10. Job: Implement properties

    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    7fdff29 View commit details
    Browse the repository at this point in the history
  11. Node: Add properties

    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    d75233b View commit details
    Browse the repository at this point in the history
  12. Node: Check for errors from sd_bus_message_append()

    Signed-off-by: Alexander Larsson <alexl@redhat.com>
    alexlarsson committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    cf01629 View commit details
    Browse the repository at this point in the history