MCPcopy Create free account
hub / github.com/78/tenbox / VmStateToString

Function VmStateToString

src/daemon/daemon_types.cpp:16–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace fs = std::filesystem;
15
16std::string VmStateToString(VmState state) {
17 switch (state) {
18 case VmState::kStopped: return "stopped";
19 case VmState::kStarting: return "starting";
20 case VmState::kRunning: return "running";
21 case VmState::kStopping: return "stopping";
22 case VmState::kCrashed: return "crashed";
23 case VmState::kRebooting: return "rebooting";
24 }
25 return "unknown";
26}
27
28VmState VmStateFromString(const std::string& value) {
29 if (value == "starting") return VmState::kStarting;

Callers 2

CollectRunningVmsFunction · 0.85
ToJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected