Public Member Functions
vcpu_factory Class Reference

Inherited by vcpu_factory_ut.

Public Member Functions

 vcpu_factory () noexcept=default
 
virtual ~vcpu_factory ()=default
 
virtual std::unique_ptr< vcpumake_vcpu (vcpuid::type vcpuid, user_data *data=nullptr)
 

Detailed Description

vCPU Factory

This class is used by the vcpu_manager to create vCPUs. Specifically, this class provides a seem that allows users of Bareflank to replace the default vCPU with their own, custom vCPUs that extend the functionality of Bareflank above and beyond what is already provided. This seems also provides a means to unit test the vcpu_manager.

To provide custom logic, define your own make_vcpu function, in your own vcpu_factory module, and load your module instead of the module that is provided by Bareflank. For an example of how to do this, please see:

Bareflank Hypervisor VPID Example
Bareflank Hypervisor CPUID Example

Definition at line 48 of file vcpu_factory.h.

Constructor & Destructor Documentation

◆ vcpu_factory()

vcpu_factory::vcpu_factory ( )
defaultnoexcept

Default Constructor

Precondition
expects: none
Postcondition
ensures: none

◆ ~vcpu_factory()

virtual vcpu_factory::~vcpu_factory ( )
virtualdefault

Destructor

Precondition
expects: none
Postcondition
ensures: none

Member Function Documentation

◆ make_vcpu()

std::unique_ptr< vcpu > vcpu_factory::make_vcpu ( vcpuid::type  vcpuid,
user_data data = nullptr 
)
virtual

Make vCPU

Precondition
expects: none
Postcondition
ensures: none
Parameters
vcpuidthe vcpuid for the vcpu to create
datauser data passed to the vcpu
Returns
returns a pointer to a newly created vCPU.

Definition at line 26 of file vcpu_factory_intel_x64.cpp.


The documentation for this class was generated from the following files: