How openbmc/x86-power-control works
x86-power-control is an OpenBMC daemon that accepts host and chassis power requests, drives configured power signals through a state machine, and exposes resulting state over D-Bus. Its capabilities include hard and graceful power transitions, reset and warm-reset handling, power-restore policy, GPIO or D-Bus event inputs, and optional slot and chassis-system reset control. The excerpts show the parser and daemon’s service, state, and event-handling responsibilities; some runtime connections are implied by documented behavior but not visible in the sampled code.
Main entry points: power_control.cpp Power daemon · config_parser.cpp Config parser · power-config-host0.json Platform config · intel Platform variants
Components 13
Power control
- Power daemon
src/power_control.cpp - Power state machine
src/power_control.cpp - Signal monitoring
src/power_control.cpp - Slot power control
src/power_control.cpp
Configuration
- Config parser
src/config_parser.cpp - Platform config
config/power-config-host0.json - Platform variants
config/intel
State and restore
- Persistent state
src/power_control.cpp - Power restore
src/power_control.cpp
D-Bus interfaces
- Host and chassis API
src/power_control.cpp - Button API
src/power_control.cpp - Chassis reset API
src/power_control.cpp
Other components
- IPMI / Redfish
Connections 14
- IPMI / Redfish → Host and chassis API: request transitions
src/power_control.cpp - Host and chassis API → Power state machine: dispatches requests
src/power_control.cpp - Platform config → Config parser: provides settings
README.md - Config parser → Power daemon: supplies parsed settings
- Platform variants → Config parser: provides settings
- Signal monitoring → Power state machine: dispatches events
src/power_control.cpp - Button API → Power state machine: dispatches button events
src/power_control.cpp - Power state machine → Persistent state: saves power state
src/power_control.cpp - Power restore → Persistent state: reads saved state
src/power_control.cpp - Power restore → Power state machine: requests restoration
src/power_control.cpp - Power daemon → Host and chassis API: registers interfaces
src/power_control.cpp - Power daemon → Button API: registers interfaces
src/power_control.cpp - Power daemon → Chassis reset API: registers optional interface
src/power_control.cpp - Power daemon → Slot power control: initializes control
src/power_control.cpp