diff options
author | johannst <johannes.stoelp@gmail.com> | 2021-07-01 23:13:27 +0200 |
---|---|---|
committer | johannst <johannes.stoelp@gmail.com> | 2021-07-01 23:13:27 +0200 |
commit | e4af1ea3b61c8e0a008a348df4b4061e5365b467 (patch) | |
tree | a12ee46b929e08a3a3b4eda574d2b937e7b9763f | |
parent | 9f025e829ab6ed468cfb51d72ac105624afc3851 (diff) | |
download | mini-kvm-rs-e4af1ea3b61c8e0a008a348df4b4061e5365b467.tar.gz mini-kvm-rs-e4af1ea3b61c8e0a008a348df4b4061e5365b467.zip |
added example to check for caps
-rw-r--r-- | examples/check_caps.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/check_caps.rs b/examples/check_caps.rs new file mode 100644 index 0000000..e4baf83 --- /dev/null +++ b/examples/check_caps.rs @@ -0,0 +1,13 @@ +use kvm_rs::cap::CapBool::*; +use kvm_rs::cap::CapInt::*; +use kvm_rs::kvm::Kvm; + +fn main() -> std::io::Result<()> { + let kvm = Kvm::new()?; + + println!("KVM_CAP_CHECK_EXTENSION_VM = {}", kvm.check_extenstion(CheckExtensionVm)); + println!("KVM_CAP_NR_VCPUS = {}", kvm.check_extenstion_int(NrVcpus)); + println!("KVM_CAP_MAX_VCPUS = {}", kvm.check_extenstion_int(MaxVcpus)); + + Ok(()) +} |