1# zx_vcpu_resume
2
3## NAME
4
5vcpu_resume - resume execution of a VCPU
6
7## SYNOPSIS
8
9```
10#include <zircon/syscalls.h>
11#include <zircon/syscalls/port.h>
12
13zx_status_t zx_vcpu_resume(zx_handle_t vcpu, zx_port_packet_t* packet);
14```
15
16## DESCRIPTION
17
18**vcpu_resume**() begins or resumes execution of *vcpu*, and blocks until it has
19paused execution. On pause of execution, *packet* is populated with reason for
20the pause. After handling the reason, execution may be resumed by calling
21**vcpu_resume**() again.
22
23N.B. Execution of a *vcpu* must be resumed on the same thread it was created on.
24
25## RIGHTS
26
27TODO(ZX-2399)
28
29## RETURN VALUE
30
31**vcpu_resume**() returns ZX_OK on success. On failure, an error value is
32returned.
33
34## ERRORS
35
36**ZX_ERR_ACCESS_DENIED** *vcpu* does not have the *ZX_RIGHT_EXECUTE* right.
37
38**ZX_ERR_BAD_HANDLE** *vcpu* is an invalid handle.
39
40**ZX_ERR_BAD_STATE** *vcpu* is in a bad state, and can not be executed.
41
42**ZX_ERR_CANCELED** *vcpu* execution was canceled while waiting on an event.
43
44**ZX_ERR_INTERNAL** There was an error executing *vcpu*.
45
46**ZX_ERR_INVALID_ARGS** *packet* is an invalid pointer.
47
48**ZX_ERR_NOT_SUPPORTED** An unsupported operation was encountered while
49executing *vcpu*.
50
51**ZX_ERR_WRONG_TYPE** *vcpu* is not a handle to a VCPU.
52
53## SEE ALSO
54
55[guest_create](guest_create.md),
56[guest_set_trap](guest_set_trap.md),
57[vcpu_create](vcpu_create.md),
58[vcpu_interrupt](vcpu_interrupt.md),
59[vcpu_read_state](vcpu_read_state.md),
60[vcpu_write_state](vcpu_write_state.md).
61