1
0
mirror of https://github.com/momo5502/hypervisor.git synced 2025-07-03 17:51:52 +00:00

More cleanup

This commit is contained in:
momo5502
2022-04-03 08:20:36 +02:00
parent 386015f94b
commit e9f0a14fff
4 changed files with 65 additions and 94 deletions

View File

@ -37,21 +37,23 @@ public:
}
private:
bool hypervisor_was_enabled_{false};
hypervisor hypervisor_{};
sleep_callback sleep_callback_{};
irp irp_{};
hypervisor hypervisor_{};
void sleep_notification(const sleep_callback::type type)
{
if (type == sleep_callback::type::sleep)
{
debug_log("Going to sleep!");
debug_log("Going to sleep...\n");
this->hypervisor_was_enabled_ = this->hypervisor_.is_enabled();
this->hypervisor_.disable();
}
if (type == sleep_callback::type::wakeup)
if (type == sleep_callback::type::wakeup && this->hypervisor_was_enabled_)
{
debug_log("Waking up!");
debug_log("Waking up...\n");
this->hypervisor_.enable();
}
}