mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-09 05:27:20 +09:00
feature #1243: Add resched flag to VMs. Includes associated logic to make it work: RM methods, OCA bindings, CLI commands. LCM updated to clear the resched flag when leaving the running state Fixes VM tests
This commit is contained in:
1 parent
d364c3e57f
commit
8ff221052d
16 files changed
+255
-37
No files matched your search
@@ -219,6 +219,17 @@ public:
|
||||
int reboot(
|
||||
int vid);
|
||||
|
||||
/**
|
||||
* Set the re-scheduling flag for the VM (must be in RUNNING state)
|
||||
* @param vid VirtualMachine identification
|
||||
* @param do_resched set or unset the flag
|
||||
* @return 0 on success, -1 if the VM does not exits or -2 if the VM is
|
||||
* in a wrong a state
|
||||
*/
|
||||
int resched(
|
||||
int vid,
|
||||
bool do_resched);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Thread id for the Dispatch Manager
|
||||
|
||||
@@ -586,6 +586,22 @@ public:
|
||||
lcm_state = s;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the re-scheduling flag
|
||||
* @param set or unset the re-schedule flag
|
||||
*/
|
||||
void set_resched(bool do_sched)
|
||||
{
|
||||
if ( do_sched == true )
|
||||
{
|
||||
resched = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
resched = 0;
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Timers
|
||||
// ------------------------------------------------------------------------
|
||||
@@ -720,6 +736,11 @@ private:
|
||||
*/
|
||||
LcmState lcm_state;
|
||||
|
||||
/**
|
||||
* Marks the VM as to be re-scheduled
|
||||
*/
|
||||
int resched;
|
||||
|
||||
/**
|
||||
* Start time, the VM enter the nebula system (in epoch)
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user