mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-13 05:47:39 +00:00
misc: configurator: Re-assign VMID based on load order
Previously if user creates a shared scenario and adds a pre-launched VM, the pre-launched VM will be assigned a VMID that's greater than service VM, which will be blocked by scenario validation. This patch re-assigns the VMID before saving as scenario XMLs based on their load order. The UI-only VM name will have no impact on VMID that's actually written to scenario XML. Tracked-On: #7419 Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
This commit is contained in:
parent
ee3a527464
commit
35dc60192f
@ -198,7 +198,20 @@ export default {
|
||||
}
|
||||
this.updateCurrentFormData()
|
||||
},
|
||||
assignVMID() {
|
||||
let vm_priority = {
|
||||
'PRE_LAUNCHED_VM': 0,
|
||||
'SERVICE_VM': 1,
|
||||
'POST_LAUNCHED_VM': 2
|
||||
}
|
||||
this.scenario.vm.sort((a, b) => {
|
||||
return vm_priority[a['load_order']] - vm_priority[b['load_order']]
|
||||
}).map((vmConfig, vmIndex) => {
|
||||
vmConfig['@id'] = vmIndex
|
||||
})
|
||||
},
|
||||
saveScenario(event) {
|
||||
this.assignVMID()
|
||||
let scenarioXMLData = configurator.convertScenarioToXML(
|
||||
{
|
||||
// simple deep copy
|
||||
|
Loading…
Reference in New Issue
Block a user