Giter Site home page Giter Site logo

hypervisor detection about libmicrovmi HOT 5 OPEN

wenzel avatar wenzel commented on May 18, 2024
hypervisor detection

from libmicrovmi.

Comments (5)

rageagainsthepc avatar rageagainsthepc commented on May 18, 2024 2

rust-lang/cargo#1197

:(

from libmicrovmi.

Wenzel avatar Wenzel commented on May 18, 2024 1

We should rename this feature as hypervisor test, and test whether a given domain name is available on for a specific hypervisor.

Implementing the same logic that LibVMI's driver_init_mode function does.

Overview:

  • xen_test
    • xen_init
      • xen_get_version
        • reading /sys/hypervisor/major/minor
      • init libxc_wrapper
      • init libxs_wrapper
    • test converting domain name to domain id
      • via xenstore directories
  • kvm_test
    • kvm_init
      • init libvirt_wrapper
      • connect to qemu:///system

from libmicrovmi.

Wenzel avatar Wenzel commented on May 18, 2024 1

Thanks for finding this.
At least this should be available in nightly already, according to:

Target-specific features for dependencies has been implemented and is available as a nightly-only feature on the latest nightly 2020-02-23. See the tracking issue at #7914.

In the meantime, we can assume linux by default.

from libmicrovmi.

Wenzel avatar Wenzel commented on May 18, 2024

I was looking at adding a new function in the Introspectable trait:

fn detect() -> Result<bool,Box<Error>> where Self: Sized {

And then you could loop over the DriverType enum, and pick the only hypervisor that will return true

from libmicrovmi.

Wenzel avatar Wenzel commented on May 18, 2024

Next here would be to enable a set of features by default.
Of course, we have to take the platform into account, Linux or Windows.

I tried to play with Cargo conditional compilation, but I can't get this thing working as I expect:
carbon

Im getting

warning: unused manifest key: target.cfg(target_os="linux").features
warning: unused manifest key: target.cfg(target_os="windows").features
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s

I saw the syntax in a SO post:
https://stackoverflow.com/questions/39709542/why-does-the-last-platform-specific-dependency-take-precedence-in-cargo

of course, if this isn't supported for the features section, we can ditch the hyper-v driver and set the default linux drivers

from libmicrovmi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.