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:
Ruben S. Montero committed 2012-04-26 19:06:49 +02:00
1 parent d364c3e57f
commit 8ff221052d
16 files changed
+255 -37

No files matched your search

+11
View File
@@ -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
+21
View File
@@ -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)
*/