Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

'vhost-user' device backends workspace

License

Apache-2.0, BSD-3-Clause licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
BSD-3-Clause
LICENSE-BSD-3-Clause
NotificationsYou must be signed in to change notification settings

rust-vmm/vhost-device

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Design

This repository hosts various 'vhost-user' device backends in their own crates.See their individual README.md files for specific information about thosecrates.

To be included here device backends must:

Here is the list of device backends that we support:

The vhost-device workspace also provides atemplateto help new developers understand how to write their own vhost-user backend.

Staging Devices

Implementing a proper VirtIO device requires co-ordination between thespecification, drivers and backend implementations. As these can allbe in flux during development it was decided introducing a stagingworkspace which would allow developers to work within the main rust-vmmproject while clearly marking the backends as not production ready.

To be included in the staging workspace there must at least be:

  • A public proposal to extend theVIRTIO specification
  • A public implementation of a device driver
  • Documentation pointing to the above

More information may be found in itsREADME file.

Here is the list of device backends instaging:

Testing and Code Coverage

Like the wider rust-vmm project we expect new features to come withcomprehensive code coverage. However as a multi-binary repositorythere are cases where avoiding a drop in coverage can be hard and anexception to the approach is allowable. These are:

  • adding a new binary target (aim at least 60% overall coverage)
  • expanding the main function (a small drop is acceptable)

However any new feature added to an existing binary should not cause adrop in coverage. The general aim should be to always improvecoverage.

Separation of Concerns

The binaries built by this repository can be run with any VMM whichcan act as a vhost-user frontend. Typically they have been tested withQEMU although the rust-vmm project doesprovide avhost-userfrontendcrate for rust based VMMs.

While it's possible to implement all parts of the backend inside thevhost-device workspace consideration should be given to separating theVirtQueue handling and response logic to a device crate in thevm-virtio repository.This way a monolithic rust-vmm VMM implementation can reuse the corelogic to service the virtio requests directly in the application.

Build dependency

The GPIO crate needs a local installation of libgpiod library to be available.If your distro ships libgpiod >= v2.0, then you should be fine.

Otherwise, you will need to build libgpiod yourself:

git clone --depth 1 --branch v2.0.x https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/cd libgpiod./autogen.sh --prefix="$PWD/install/"make install

In order to inform tools about the build location, you can now set:

export PKG_CONFIG_PATH="<PATH-TO-LIBGPIOD>/install/lib/pkgconfig/"

To prevent setting this in every terminal session, you can also configurecargo toset it automatically.

Xen support

Supporting Xen requires special handling while mapping the guest memory. Thevm-memory crate implements xen memory mapping support via a separate featurexen, and this crate uses the same feature name to enable Xen support.

It was decided by therust-vmm maintainers to keep the interface simple andbuild the crate for either standard Unix memory mapping or Xen, and not both.


[8]ページ先頭

©2009-2025 Movatter.jp