---
title: "hv_vcpus_exit(_:_:)"
framework: hypervisor
role: symbol
role_heading: Function
path: "hypervisor/hv_vcpus_exit(_:_:)"
---

# hv_vcpus_exit(_:_:)

Forces an immediate exit of a set of vCPUs of the VM.

## Declaration

```swift
func hv_vcpus_exit(_ vcpus: UnsafeMutablePointer<hv_vcpu_t>, _ vcpu_count: UInt32) -> hv_return_t
```

## Parameters

- `vcpus`: An array of vCPU instances.
- `vcpu_count`: The number of vCPUs in the array.

## Return Value

Return Value HV_SUCCESS if the operation was successful, otherwise an error code specified in hv_return_t.

## See Also

### Runtime

- [hv_vcpu_run(_:)](hypervisor/hv_vcpu_run(_:).md)
- [hv_vcpu_get_pending_interrupt(_:_:_:)](hypervisor/hv_vcpu_get_pending_interrupt(_:_:_:).md)
- [hv_vcpu_set_pending_interrupt(_:_:_:)](hypervisor/hv_vcpu_set_pending_interrupt(_:_:_:).md)
- [hv_vcpu_get_exec_time(_:_:)](hypervisor/hv_vcpu_get_exec_time(_:_:).md)
- [hv_interrupt_type_t](hypervisor/hv_interrupt_type_t.md)
- [Exits](hypervisor/exits.md)
