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

add the systemd output format #671

Closed
wants to merge 5 commits into from
Closed

Conversation

npf
Copy link
Contributor

@npf npf commented Jun 27, 2024

Add format expected by the systemd dbus api.

@npf npf marked this pull request as draft June 27, 2024 12:43
@npf npf force-pushed the bitmap_systemd branch 5 times, most recently from 074dea2 to bc0b448 Compare July 3, 2024 14:37
example of usage:

```
busctl call org.freedesktop.systemd1 \
  /org/freedesktop/systemd1 \
  org.freedesktop.systemd1.Manager \
  StartUnit ss my_slice.slice fail

busctl call org.freedesktop.systemd1 \
  /org/freedesktop/systemd1 \
  org.freedesktop.systemd1.Manager \
  SetUnitProperties 'sba(sv)' \
  my_slice.slice 1 1
  $(hwloc-calc pu:0 pu:31 pu:32 pu:63 pu:64 pu:77
--cpuset-output-format systemd)

busctl call org.freedesktop.systemd1 \
  /org/freedesktop/systemd1 \
  org.freedesktop.systemd1.Manager \
  StartTransientUnit 'ssa(sv)a(sa(sv))' \
  my_scope.scope fail 3 \
  Delegate b 1
  PIDs au 1 $$ \
  Slice s my_slice.slice \
  0
```

Refs:
-
https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.systemd1.html
- https://dbus.freedesktop.org/doc/dbus-specification.html
print nothing if input is "".
print "AllowedCPUs ay ..." otherwise.
utils/hwloc/.libs/hwloc-calc --cpuset-input-format hwloc 0xf...f
--cpuset-output-format systemd
hwloc-calc: bitmap.c:588: hwloc_bitmap_systemd_snprintf: Assertion
`set->infinite == 0' failed.
@npf
Copy link
Contributor Author

npf commented Aug 21, 2024

Replaced by #684, in order to not impact the hwloc API, as discussed.

@npf npf closed this Aug 21, 2024
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.

1 participant