libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
Hypervisor.hh
Go to the documentation of this file.
1/*
2 * Copyright 2021 Assured Information Security, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <introvirt/core/fwd.hh>
19
20#include <cstdint>
21#include <memory>
22#include <string>
23#include <vector>
24
25namespace introvirt {
26
33 public:
37 std::string domain_name;
38
42 uint32_t domain_id;
43};
44
49 public:
58 virtual std::unique_ptr<Domain> attach_domain(uint32_t domain_id) = 0;
59
68 virtual std::unique_ptr<Domain> attach_domain(const std::string& domain_name) = 0;
69
75 virtual std::vector<DomainInformation> get_running_domains() = 0;
76
82 virtual std::string hypervisor_name() const = 0;
83
89 virtual std::string hypervisor_version() const = 0;
90
96 virtual std::string hypervisor_patch_version() const = 0;
97
103 virtual std::string library_name() const = 0;
104
110 virtual std::string library_version() const = 0;
111
115 virtual ~Hypervisor();
116
125 static std::unique_ptr<Hypervisor> instance();
126
127 protected:
132};
133
134} // namespace introvirt
Information about a domain.
Definition Hypervisor.hh:32
uint32_t domain_id
The numeric idenifier of the domain.
Definition Hypervisor.hh:42
std::string domain_name
The name of the domain.
Definition Hypervisor.hh:37
Abstract class for managing a hypervisor.
Definition Hypervisor.hh:48
virtual ~Hypervisor()
Destroy the instance.
virtual std::string library_version() const =0
Gets the version of the hypervisor library 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 hypervisor_name() const =0
Gets the name of the hypervisor.
static std::unique_ptr< Hypervisor > instance()
Get an instance of the hypervisor.
virtual std::vector< DomainInformation > get_running_domains()=0
Get information about the running domains.
virtual std::unique_ptr< Domain > attach_domain(const std::string &domain_name)=0
Attach to a Domain based on name.
virtual std::string hypervisor_version() const =0
Gets the version of the hypervisor as a string.
Hypervisor()
Construct a new Hypervisor object.
virtual std::string library_name() const =0
Gets the name of the library used for interacting with the hypervisor.
virtual std::unique_ptr< Domain > attach_domain(uint32_t domain_id)=0
Attach to a Domain based on numeric identifier.
Core IntroVirt classes.
Definition Cr0.hh:20