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

gamemode: add new portal for GameMode access #314

Merged
merged 4 commits into from May 20, 2019

Commits on May 17, 2019

  1. utils: remove unused variables

    Don't use it, lose it!
    gicmo committed May 17, 2019
    Copy the full SHA
    5deb733 View commit details
    Browse the repository at this point in the history
  2. utils: add get_instance helper for flatpaks

    Retrieves the flatpak instance id from the .flatpak_info keyfile.
    gicmo committed May 17, 2019
    Copy the full SHA
    0fc5fe9 View commit details
    Browse the repository at this point in the history
  3. utils: add function to map process ids

    Containers can use pid_namespaces(7) to encapsulate the processes
    running inside the container from seeing the process ids (pids)
    of the host. A generic way to translate a process identifier from
    within the container to the outside that does not need the
    cooperation of the target process is to use /proc which contains
    the information about the namespace for each process as well as
    the process identifier of the process in each namespace. The
    namespace id can be obtained via '/proc/<pid>/ns/pid'; the pids
    for all the namespaces via '/proc/<pid>/status' and its 'NSpid'
    field.
    For Flatpaks, which uses bubble wrap, the bwrapinfo.js file has the
    child-pid field, which is the bwrap process inside the sandbox.
    Via this pid the pid namespace id can be determined. All process in
    /proc are then scanned and filtered for ones that belong to the same
    pid namespace. For those their 'status' file is parsed and the pid
    within the namespace matched against the ones that need to be
    translated.
    gicmo committed May 17, 2019
    Copy the full SHA
    23bb988 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2019

  1. gamemode: add new portal for GameMode access

    Add a new portal so that GameMode service can be accessed from
    within the sandbox. GameMode expects to get the process id (pid)
    of the game so it can:
      - track the lifetime of the game
      - modify process parameters (nice level, scheduler policy, ...)
      - resolve the executable name and trigger configured actions
    
    Since processes inside the sandbox run in a separate pid namespace
    sending the client pid that was handed to the portal is not what
    GameMode is expecting, since it needs the pid outside the sandbox.
    Therefore the pid is translated via xdg_app_info_map_pids().
    gicmo committed May 19, 2019
    Copy the full SHA
    db3858c View commit details
    Browse the repository at this point in the history