1# zx_vcpu_read_state 2 3## NAME 4 5vcpu_read_state - read the state of a VCPU 6 7## SYNOPSIS 8 9``` 10#include <zircon/syscalls.h> 11#include <zircon/syscalls/hypervisor.h> 12 13zx_status_t zx_vcpu_read_state(zx_handle_t vcpu, uint32_t kind, void* buffer, 14 size_t len); 15``` 16 17## DESCRIPTION 18 19**vcpu_read_state**() reads the state of *vcpu* as specified by *kind* into 20*buffer*. It is only valid to read the state of *vcpu* when execution has been 21paused. 22 23*kind* must be *ZX_VCPU_STATE*. 24 25## RIGHTS 26 27TODO(ZX-2399) 28 29## RETURN VALUE 30 31**vcpu_read_state**() 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_READ* 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 state can not be read. 41 42**ZX_ERR_INVALID_ARGS** *kind* does not name a known VCPU state, *buffer* is an 43invalid pointer, or *len* does not match the expected size of *kind*. 44 45**ZX_ERR_WRONG_TYPE** *vcpu* is not a handle to a VCPU. 46 47## SEE ALSO 48 49[guest_create](guest_create.md), 50[guest_set_trap](guest_set_trap.md), 51[vcpu_create](vcpu_create.md), 52[vcpu_resume](vcpu_resume.md), 53[vcpu_interrupt](vcpu_interrupt.md), 54[vcpu_write_state](vcpu_write_state.md). 55