libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
ivversion.cc

Prints IntroVirt library version and hypervisor/patch information. Minimal example of Hypervisor::instance() and VersionInfo usage.

#include <iostream>
using namespace std;
using namespace introvirt;
int main(int argc, char** argv) {
std::cout << "libintrovirt " << introvirt::VersionInfo::version();
if (VersionInfo::is_optimized_build())
std::cout << " Optimized";
if (VersionInfo::is_debug_build())
std::cout << " Debug";
std::cout << '\n';
try {
auto hypervisor = Hypervisor::instance();
std::cout << " Hypervisor : " << hypervisor->hypervisor_name() << ' '
<< hypervisor->hypervisor_version() << '\n';
std::cout << " IntroVirt Patch : " << hypervisor->hypervisor_patch_version() << '\n';
std::cout << " " << hypervisor->library_name() << " " << hypervisor->library_version()
<< '\n';
std::cout << "No supported hypervisor detected\n";
return 1;
}
return 0;
}
Thrown when no supported hypervisor can be found.
Definition UnsupportedHypervisorException.hh:25
static std::string version()
Get the libintrovirt version as a string.
int main(int argc, char **argv)
Definition main.c:35
Core IntroVirt classes.
Definition Cr0.hh:20