mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-26 07:21:37 +00:00
configurator: fix single vm scenario load issue
fix single vm scenario load issue Tracked-On: #6691 Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
This commit is contained in:
parent
578a482626
commit
3f1057b747
@ -268,22 +268,34 @@ export class ProgramLayer extends EventBase {
|
|||||||
let scenarioConfig = await this.xmlLayer.loadScenario(scenarioXMLPath)
|
let scenarioConfig = await this.xmlLayer.loadScenario(scenarioXMLPath)
|
||||||
this.initScenario()
|
this.initScenario()
|
||||||
this.scenarioData.hv = scenarioConfig.hv;
|
this.scenarioData.hv = scenarioConfig.hv;
|
||||||
scenarioConfig.vm.map((vmConfig, index) => {
|
if (scenarioConfig.hasOwnProperty('vm')) {
|
||||||
let vmType = vmConfig.load_order
|
if (!_.isArray(scenarioConfig.vm)) {
|
||||||
if (!this.scenarioData.vm.hasOwnProperty(vmType)) {
|
if (_.isObject(scenarioConfig.vm)) {
|
||||||
try {
|
scenarioConfig.vm = [scenarioConfig.vm]
|
||||||
ThrowError('VM @id=' + index + ' VMType Does Not Exist')
|
} else {
|
||||||
} catch (e) {
|
console.log(scenarioConfig.vm);
|
||||||
|
debugger;
|
||||||
|
this.onScenarioDataUpdateEvent()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
//fix pci_devs is object issue
|
|
||||||
if (vmConfig.hasOwnProperty("pci_devs") && vmConfig.pci_devs.hasOwnProperty("pci_dev") && _.isString(vmConfig.pci_devs.pci_dev)) {
|
|
||||||
vmConfig.pci_devs.pci_dev = [vmConfig.pci_devs.pci_dev]
|
|
||||||
}
|
|
||||||
this.addVM(vmType, vmConfig)
|
|
||||||
}
|
}
|
||||||
})
|
scenarioConfig.vm.map((vmConfig, index) => {
|
||||||
|
let vmType = vmConfig.load_order
|
||||||
|
if (!this.scenarioData.vm.hasOwnProperty(vmType)) {
|
||||||
|
try {
|
||||||
|
ThrowError('VM @id=' + index + ' VMType Does Not Exist')
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//fix pci_devs is object issue
|
||||||
|
if (vmConfig.hasOwnProperty("pci_devs") && vmConfig.pci_devs.hasOwnProperty("pci_dev") && _.isString(vmConfig.pci_devs.pci_dev)) {
|
||||||
|
vmConfig.pci_devs.pci_dev = [vmConfig.pci_devs.pci_dev]
|
||||||
|
}
|
||||||
|
this.addVM(vmType, vmConfig)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
this.onScenarioDataUpdateEvent()
|
this.onScenarioDataUpdateEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user