From 30163dc5ce7ff624887977c898288f6bfde47e4b Mon Sep 17 00:00:00 2001 From: Sven Friedrich Date: Thu, 20 Jun 2024 10:14:03 +0200 Subject: [PATCH] feat(hypervisor): add partition idle logic --- hypervisor/src/hypervisor/scheduler.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hypervisor/src/hypervisor/scheduler.rs b/hypervisor/src/hypervisor/scheduler.rs index ad3e1a3..d341112 100644 --- a/hypervisor/src/hypervisor/scheduler.rs +++ b/hypervisor/src/hypervisor/scheduler.rs @@ -72,6 +72,12 @@ impl<'a> PartitionTimeframeScheduler<'a> { return Ok(()); } + if let OperatingMode::Idle = self.partition.get_base_run().1.mode() { + trace!("Partition is IDLE, waiting till the end of the partition time window"); + std::thread::sleep(self.timeout.remaining_time()); + return Ok(()); + } + // If we are in the normal mode at the beginning of the time frame, // only then we may schedule the periodic process inside a partition if let OperatingMode::Normal = self.partition.get_base_run().1.mode() {