- if (get_state() != s4u::VirtualMachine::state::RUNNING) {
- const char* stateName;
- switch (get_state()) {
- case s4u::VirtualMachine::state::CREATED:
- stateName = "created, but not yet started";
- break;
- case s4u::VirtualMachine::state::SUSPENDED:
- stateName = "suspended";
- break;
- case s4u::VirtualMachine::state::DESTROYED:
- stateName = "destroyed";
- break;
- default: /* SURF_VM_STATE_RUNNING or unexpected values */
- THROW_IMPOSSIBLE;
- }
- XBT_VERB("Shutting down the VM %s even if it's not running but %s", piface_->get_cname(), stateName);
- }
+ if (get_state() != s4u::VirtualMachine::State::RUNNING)
+ XBT_VERB("Shutting down the VM %s even if it's not running but in state %s", piface_->get_cname(),
+ s4u::VirtualMachine::to_c_str(get_state()));