libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
introvirt::Hypervisor Class Referenceabstract

Abstract class for managing a hypervisor. More...

#include <Hypervisor.hh>

Public Member Functions

virtual std::unique_ptr< Domainattach_domain (uint32_t domain_id)=0
 Attach to a Domain based on numeric identifier.
 
virtual std::unique_ptr< Domainattach_domain (const std::string &domain_name)=0
 Attach to a Domain based on name.
 
virtual std::vector< DomainInformationget_running_domains ()=0
 Get information about the running domains.
 
virtual std::string hypervisor_name () const =0
 Gets the name of the hypervisor.
 
virtual std::string hypervisor_version () const =0
 Gets the version of the hypervisor as a string.
 
virtual std::string hypervisor_patch_version () const =0
 Gets the version of the hypervisor's IntroVirt patch as a string.
 
virtual std::string library_name () const =0
 Gets the name of the library used for interacting with the hypervisor.
 
virtual std::string library_version () const =0
 Gets the version of the hypervisor library as a string.
 
virtual ~Hypervisor ()
 Destroy the instance.
 

Static Public Member Functions

static std::unique_ptr< Hypervisorinstance ()
 Get an instance of the hypervisor.
 

Protected Member Functions

 Hypervisor ()
 Construct a new Hypervisor object.
 

Detailed Description

Abstract class for managing a hypervisor.

Constructor & Destructor Documentation

◆ ~Hypervisor()

virtual introvirt::Hypervisor::~Hypervisor ( )
virtual

Destroy the instance.

◆ Hypervisor()

introvirt::Hypervisor::Hypervisor ( )
protected

Construct a new Hypervisor object.

Member Function Documentation

◆ attach_domain() [1/2]

virtual std::unique_ptr< Domain > introvirt::Hypervisor::attach_domain ( const std::string &  domain_name)
pure virtual

Attach to a Domain based on name.

Parameters
domain_nameThe name of the domain
Returns
The attached domain
Exceptions
DomainBusyExceptionIf the domain is already attached to by an IntroVirt process
NoSuchDomainExceptionIf the domain could not be found using the given domain_id

◆ attach_domain() [2/2]

virtual std::unique_ptr< Domain > introvirt::Hypervisor::attach_domain ( uint32_t  domain_id)
pure virtual

Attach to a Domain based on numeric identifier.

Parameters
domain_idThe numeric identifier for the domain
Returns
The attached domain
Exceptions
DomainBusyExceptionIf the domain is already attached to by an IntroVirt process
NoSuchDomainExceptionIf the domain could not be found using the given domain_id

◆ get_running_domains()

virtual std::vector< DomainInformation > introvirt::Hypervisor::get_running_domains ( )
pure virtual

Get information about the running domains.

Returns
A vector of domain information

◆ hypervisor_name()

virtual std::string introvirt::Hypervisor::hypervisor_name ( ) const
pure virtual

Gets the name of the hypervisor.

Returns
The name of the hypervisor (i.e., "KVM")

◆ hypervisor_patch_version()

virtual std::string introvirt::Hypervisor::hypervisor_patch_version ( ) const
pure virtual

Gets the version of the hypervisor's IntroVirt patch as a string.

Returns
the version of the hypervisor's IntroVirt patch

◆ hypervisor_version()

virtual std::string introvirt::Hypervisor::hypervisor_version ( ) const
pure virtual

Gets the version of the hypervisor as a string.

Returns
The version of the hypervisor as a string

◆ instance()

static std::unique_ptr< Hypervisor > introvirt::Hypervisor::instance ( )
static

Get an instance of the hypervisor.

This will try to find the correct hypervisor (KVM/Xen)

Returns
A hypervisor instance
Exceptions
UnsupportedHypervisorExceptionIf no hypervisor could be attached to

◆ library_name()

virtual std::string introvirt::Hypervisor::library_name ( ) const
pure virtual

Gets the name of the library used for interacting with the hypervisor.

Returns
The name of the library (i.e., "libintrovirt-kvm")

◆ library_version()

virtual std::string introvirt::Hypervisor::library_version ( ) const
pure virtual

Gets the version of the hypervisor library as a string.

Returns
The version of the hypervisor as a string

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