From 56a16385172e4c2ef2949468bfd3c6dabb2a5913 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Sun, 7 Jun 2020 17:50:38 -0700 Subject: [PATCH] hypervisor: Introduce hypervisor crate The purpose of this trait is to add support for other hypervisors than KVM, like e.g. Microsoft Hyper-V. Further commits will define additional hypervisor related traits like Vcpu and Vm. Each of the supported hypervisor will need to implement all traits defined from the hypervisor crate. Signed-off-by: Muminul Islam --- Cargo.lock | 5 +++++ Cargo.toml | 1 + hypervisor/Cargo.toml | 8 ++++++++ hypervisor/src/lib.rs | 8 ++++++++ 4 files changed, 22 insertions(+) create mode 100644 hypervisor/Cargo.toml create mode 100644 hypervisor/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index b0c1b657f..257ccff98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -187,6 +187,7 @@ dependencies = [ "dirs", "epoll", "futures", + "hypervisor", "lazy_static", "libc", "log 0.4.8", @@ -453,6 +454,10 @@ dependencies = [ "libc", ] +[[package]] +name = "hypervisor" +version = "0.1.0" + [[package]] name = "idna" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index 0c480fc59..1b554bfdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ arc-swap = ">=0.4.4" clap = { version = "2.33.1", features=["wrap_help"] } epoll = ">=4.0.1" futures = { version = "0.3.5", features = ["thread-pool"] } +hypervisor = { path = "hypervisor" } lazy_static = "1.4.0" libc = "0.2.71" log = { version = "0.4.8", features = ["std"] } diff --git a/hypervisor/Cargo.toml b/hypervisor/Cargo.toml new file mode 100644 index 000000000..42424cc15 --- /dev/null +++ b/hypervisor/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "hypervisor" +version = "0.1.0" +authors = ["Muminul Islam"] +edition = "2018" + + +[dependencies] \ No newline at end of file diff --git a/hypervisor/src/lib.rs b/hypervisor/src/lib.rs new file mode 100644 index 000000000..2b8f852d4 --- /dev/null +++ b/hypervisor/src/lib.rs @@ -0,0 +1,8 @@ +// Copyright © 2019 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright © 2020, Microsoft Corporation +// +// Copyright 2018-2019 CrowdStrike, Inc. +//