MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_suspend

Function vm_suspend

freebsd/amd64/vmm/vmm.c:1609–1634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1607}
1608
1609int
1610vm_suspend(struct vm *vm, enum vm_suspend_how how)
1611{
1612 int i;
1613
1614 if (how <= VM_SUSPEND_NONE || how >= VM_SUSPEND_LAST)
1615 return (EINVAL);
1616
1617 if (atomic_cmpset_int(&vm->suspend, 0, how) == 0) {
1618 VM_CTR2(vm, "virtual machine already suspended %d/%d",
1619 vm->suspend, how);
1620 return (EALREADY);
1621 }
1622
1623 VM_CTR1(vm, "virtual machine successfully suspended %d", how);
1624
1625 /*
1626 * Notify all active vcpus that they are now suspended.
1627 */
1628 for (i = 0; i < vm->maxcpus; i++) {
1629 if (CPU_ISSET(i, &vm->active_cpus))
1630 vcpu_notify_event(vm, i, false);
1631 }
1632
1633 return (0);
1634}
1635
1636void
1637vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip)

Callers 2

vm_handle_hltFunction · 0.70
nested_faultFunction · 0.70

Calls 1

vcpu_notify_eventFunction · 0.85

Tested by

no test coverage detected