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

lxd/device: unix-hotplug ownership fix #14417

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kadinsayani
Copy link
Contributor

@kadinsayani kadinsayani commented Nov 7, 2024

Fixes the second bug raised in #14266.

This PR adds a setting, ownership.inherit for unix-hotplug devices and a function unixDeviceOwnership() which returns device ownership.

New behaviour:

  • The default setting for ownership.inherit is false;
  • When ownership.inherit is set to true, the device ownership is inherited from the host;
  • ownership.inherit cannot be set to true when gid or uid are set.

Existing behaviour (unchanged):

  • When gid and uid are set, they are used for device ownership;
  • If gid and uid are not present in the config, root (0) ownership is used.

@kadinsayani kadinsayani force-pushed the 14266-unix-hotplug-ownership-fix branch from a0b63fd to 8fed8a3 Compare November 7, 2024 23:07
@kadinsayani kadinsayani changed the title unix-hotplug ownership fix lxd/device: unix-hotplug ownership fix Nov 7, 2024
@kadinsayani kadinsayani force-pushed the 14266-unix-hotplug-ownership-fix branch from 8fed8a3 to 0d5c055 Compare November 7, 2024 23:20
simondeziel
simondeziel previously approved these changes Nov 8, 2024
@tomponline
Copy link
Member

@kadinsayani please can you update the PR description to explain the change of behaviour in this PR and what, if any, will change for existing users?

@kadinsayani
Copy link
Contributor Author

@kadinsayani please can you update the PR description to explain the change of behaviour in this PR and what, if any, will change for existing users?

Sure thing!

@kadinsayani kadinsayani force-pushed the 14266-unix-hotplug-ownership-fix branch 2 times, most recently from db02e22 to 4c9ee63 Compare November 12, 2024 16:08
@github-actions github-actions bot added the Documentation Documentation needs updating label Nov 12, 2024
Copy link

Heads up @mionaalex - the "Documentation" label was applied to this issue.

@kadinsayani kadinsayani force-pushed the 14266-unix-hotplug-ownership-fix branch 3 times, most recently from a25f26f to 81478b0 Compare November 12, 2024 18:37
@kadinsayani
Copy link
Contributor Author

I noticed some wording inconsistencies in the documentation for unix-hotplug and the other unix device types. I've opened #14451 to track the issue and engage @minaelee for feedback. I'll open up a separate PR to update the docs and resolve the issue.

simondeziel
simondeziel previously approved these changes Nov 13, 2024
@kadinsayani kadinsayani force-pushed the 14266-unix-hotplug-ownership-fix branch 2 times, most recently from 13be986 to ebc953a Compare November 13, 2024 17:19
@kadinsayani
Copy link
Contributor Author

@tomponline, do we need an API extension for the new setting even if we're not adding tests?

Signed-off-by: Kadin Sayani <[email protected]>
@kadinsayani kadinsayani force-pushed the 14266-unix-hotplug-ownership-fix branch from ebc953a to c78aeda Compare November 13, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Documentation needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants