Andrew Geissler | fe270d3 | 2021-01-27 14:06:46 -0600 | [diff] [blame] | 1 | #include "config.h" |
| 2 | |
| 3 | #include "hypervisor_state_manager.hpp" |
| 4 | |
| 5 | #include <sdbusplus/bus.hpp> |
| 6 | |
| 7 | #include <cstdlib> |
| 8 | |
Amithash Prasasd | 2eb6029 | 2024-08-13 19:19:07 -0700 | [diff] [blame] | 9 | using HostState = sdbusplus::server::xyz::openbmc_project::state::Host; |
| 10 | |
Andrew Geissler | fe270d3 | 2021-01-27 14:06:46 -0600 | [diff] [blame] | 11 | int main() |
| 12 | { |
| 13 | auto bus = sdbusplus::bus::new_default(); |
| 14 | |
| 15 | // For now, we only have one instance of the hypervisor |
| 16 | auto objPathInst = std::string{HYPERVISOR_OBJPATH} + '0'; |
| 17 | |
| 18 | // Add sdbusplus ObjectManager. |
Amithash Prasasd | 2eb6029 | 2024-08-13 19:19:07 -0700 | [diff] [blame] | 19 | sdbusplus::server::manager_t objManager(bus, |
| 20 | HostState::namespace_path::value); |
Andrew Geissler | fe270d3 | 2021-01-27 14:06:46 -0600 | [diff] [blame] | 21 | |
| 22 | phosphor::state::manager::Hypervisor manager(bus, objPathInst.c_str()); |
| 23 | |
| 24 | bus.request_name(HYPERVISOR_BUSNAME); |
| 25 | |
| 26 | while (true) |
| 27 | { |
| 28 | bus.process_discard(); |
| 29 | bus.wait(); |
| 30 | } |
| 31 | return 0; |
| 32 | } |