Function

hv_vcpu_create

Creates a vCPU instance for the current thread.

Declaration

hv_return_t hv_vcpu_create(hv_vcpuid_t *vcpu, hv_vcpu_options_t flags);

Parameters

vcpu

On return, this argument is populated with the ID of a vCPU.

flags

Reserved. Pass HV_VCPU_DEFAULT to this argument.

Return Value

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

See Also

Creating and Managing vCPU Instances

hv_vcpu_destroy

Destroys the vCPU instance associated with the current thread.

hv_vcpu_run

Executes a vCPU.

hv_vcpu_interrupt

Forces an immediate VMEXIT of a set of vCPU instances of the VM.

hv_vcpu_invalidate_tlb

Invalidates the translation look-aside buffer (TLB) of a vCPU.

hv_vcpu_flush

Flushes the cached state of a vCPU.

hv_vcpu_enable_native_msr

Enables or disables a machine specific register (MSR) to be used natively by the VM.

hv_vcpu_get_exec_time

Returns, by reference, the cumulative execution time of a vCPU, in nanoseconds.