mirror of
https://github.com/unraid/webgui.git
synced 2026-04-26 04:11:12 -05:00
Added CPU isolation
Both CPU pinning and CPU isolation is possible thru the GUI
This commit is contained in:
@@ -20,7 +20,7 @@ foreach($_POST as $key => $val) {
|
||||
list($name,$cpu) = explode(':',$key);
|
||||
$map[urldecode($name)] .= "$cpu,";
|
||||
}
|
||||
// map holds the list of each vm or container and its newly proposed cpu assignments
|
||||
// map holds the list of each vm, container or isolcpus and its newly proposed cpu assignments
|
||||
$map = array_map(function($d){return substr($d,0,-1);},$map);
|
||||
|
||||
switch ($_POST['id']) {
|
||||
@@ -72,6 +72,14 @@ case 'ct':
|
||||
}
|
||||
$reply = ['success' => (count($changes) ? implode(';',$changes) : '')];
|
||||
break;
|
||||
case 'is':
|
||||
// report changed isolcpus in temporary file
|
||||
foreach ($map as $name => $isolcpu) {
|
||||
file_put_contents("/var/tmp/$name.tmp",$isolcpu);
|
||||
$changes[] = $name;
|
||||
}
|
||||
$reply = ['success' => (count($changes) ? implode(';',$changes) : '')];
|
||||
break;
|
||||
}
|
||||
// signal changes
|
||||
header('Content-Type: application/json');
|
||||
|
||||
Reference in New Issue
Block a user