Merge pull request #1180 from SimonFair/VM-Template-Fixes

Fix changing from passthru to custom CPU.
This commit is contained in:
tom mortensen
2022-10-28 09:37:22 -07:00
committed by GitHub
4 changed files with 5 additions and 3 deletions

View File

@@ -1188,6 +1188,8 @@
if (!$new['devices']['tpm']) unset($old['devices']['tpm']);
// remove existing auto-generated settings
unset($old['cputune']['vcpupin'],$old['devices']['video'],$old['devices']['disk'],$old['devices']['interface'],$old['devices']['filesystem'],$old['cpu']['@attributes'],$old['os']['boot'],$old['os']['loader'],$old['os']['nvram']);
// Remove old CPU cache and features
unset($old['cpu']['cache'], $old['cpu']['feature']) ;
// set namespace
$new['metadata']['vmtemplate']['@attributes']['xmlns'] = 'unraid';
}

View File

@@ -313,7 +313,7 @@
<td>_(CPU Mode)_:</td>
<td>
<select name="domain[cpumode]" title="_(define type of cpu presented to this vm)_">
<?mk_dropdown_options(['host-passthrough' => _('Host Passthrough').' (' . $strCPUModel . ')', 'emulated' => _('Emulated').' ('._('QEMU64').')'], $arrConfig['domain']['cpumode']);?>
<?mk_dropdown_options(['host-passthrough' => _('Host Passthrough').' (' . $strCPUModel . ')', 'custom' => _('Emulated').' ('._('QEMU64').')'], $arrConfig['domain']['cpumode']);?>
</select>
</td>
</tr>

View File

@@ -543,7 +543,7 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
<td>_(CPU Mode)_:</td>
<td>
<select name="domain[cpumode]" title="_(define type of cpu presented to this vm)_">
<?mk_dropdown_options(['host-passthrough' => _('Host Passthrough').' (' . $strCPUModel . ')', 'emulated' => _('Emulated').' ('._('QEMU64').')'], $arrConfig['domain']['cpumode']);?>
<?mk_dropdown_options(['host-passthrough' => _('Host Passthrough').' (' . $strCPUModel . ')', 'custom' => _('Emulated').' ('._('QEMU64').')'], $arrConfig['domain']['cpumode']);?>
</select>
</td>
</tr>

View File

@@ -542,7 +542,7 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
<td>_(CPU Mode)_:</td>
<td>
<select name="domain[cpumode]" title="_(define type of cpu presented to this vm)_">
<?mk_dropdown_options(['host-passthrough' => _('Host Passthrough').' (' . $strCPUModel . ')', 'emulated' => _('Emulated').' ('._('QEMU64').')'], $arrConfig['domain']['cpumode']);?>
<?mk_dropdown_options(['host-passthrough' => _('Host Passthrough').' (' . $strCPUModel . ')', 'custom' => _('Emulated').' ('._('QEMU64').')'], $arrConfig['domain']['cpumode']);?>
</select>
</td>
</tr>