mirror of
https://github.com/unraid/webgui.git
synced 2026-01-14 05:30:07 -06:00
CPU pinning: preserve "emulatorpin" entry
This commit is contained in:
@@ -52,6 +52,7 @@ case 'vm':
|
||||
$xml->cpu->topology['cores'] = $cores;
|
||||
$xml->cpu->topology['threads'] = $threads;
|
||||
$xml->vcpu = $vcpus;
|
||||
$pin = []; foreach ($xml->cputune->emulatorpin->attributes() as $key => $value) $pin[$key] = (string)$value;
|
||||
unset($xml->cputune);
|
||||
$xml->addChild('cputune');
|
||||
for ($i = 0; $i < $vcpus; $i++) {
|
||||
@@ -59,6 +60,10 @@ case 'vm':
|
||||
$vcpu['vcpu'] = $i;
|
||||
$vcpu['cpuset'] = $cpuset[$i];
|
||||
}
|
||||
if ($pin) {
|
||||
$attr = $xml->cputune->addChild('emulatorpin');
|
||||
foreach ($pin as $key => $value) $attr[$key] = $value;
|
||||
}
|
||||
// stop running vm first?
|
||||
$running = $lv->domain_get_state($dom)=='running';
|
||||
if ($running) {
|
||||
|
||||
Reference in New Issue
Block a user