HV: add get_sos_vm api

This patch creates a new get_sos_vm() api to replace get_vm_from_vmid(0U)
because VM 0 might not be SOS VM now;

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun
2019-01-21 15:33:17 +08:00
committed by Eddie Dong
parent f3014a3c89
commit ec199d9609
5 changed files with 15 additions and 7 deletions

View File

@@ -228,7 +228,7 @@ void vpci_reset_ptdev_intr_info(const struct acrn_vm *target_vm, uint16_t vbdf,
} else {
/* Return this PCI device to SOS */
if (vdev->vpci->vm == target_vm) {
vm = get_vm_from_vmid(0U);
vm = get_sos_vm();
if (vm != NULL) {
vdev->vpci = &vm->vpci;