Git Product home page Git Product logo

mdevctl's Introduction

mdevctl is a mediated device management utility for Linux

Description
-----------

mdevctl is a tool for creating/removing, starting/stopping, listing,
and managing persistence of devices created within the mediated device
framework.  mdevctl integrates with udev and systemd such that all
mediated devices are automatically recorded for persistence and may
be started and stopped via systemd services.

This project is early in development, man pages and spec files are
intended, but don't exist yet.  Contribute!

License
-------
Licensed under the GNU Lesser General Public License aka LGPL v2.1.
See COPYING for details.

Source repository
-----------------
https://github.com/mdevctl/mdevctl

Installation
------------
'make install' for now, packaging coming.

Architecture
------------
mdevctl inserts udev rules to trigger when a devices is added on the
mdev subsystem.  The device is recorded in a persistent file under
/etc/mdevctl.d/.  Later, if a rule triggers indicating a device was
added for which we have persistent mdev information stored, mdevctl
provides information to have systemd start services invoking those
persistent mdev devices.

The mdevctl scripts are split between libexec and sbin, the latter is
intended for user consumption while the former is invoked by udev,
systemd, or the sbin script.  This allows consistency in active mdevs
being managed through systemd whether invoked from the command line
or udev events.

Usage
-----

List all possible mdev types supported in the system:

# mdevctl list-all
0000:00:02.0
  i915-GVTg_V4_2
    Available instances: 2
    Device API: vfio-pci
    Description: low_gm_size: 256MB high_gm_size: 1024MB fence: 4 resolution: 1920x1200 weight: 8 
  i915-GVTg_V4_1
    Available instances: 1
    Device API: vfio-pci
    Description: low_gm_size: 512MB high_gm_size: 2048MB fence: 4 resolution: 1920x1200 weight: 16 
  i915-GVTg_V4_8
    Available instances: 7
    Device API: vfio-pci
    Description: low_gm_size: 64MB high_gm_size: 384MB fence: 4 resolution: 1024x768 weight: 2 
  i915-GVTg_V4_4
    Available instances: 5
    Device API: vfio-pci
    Description: low_gm_size: 128MB high_gm_size: 512MB fence: 4 resolution: 1920x1200 weight: 4 

Create an mdev devices:

# mdevctl create-mdev `uuidgen` 0000:00:02.0 i915-GVTg_V4_8

List active mdev devices:

# mdevctl list-mdevs
ad8a4ad1-32cd-4cd4-8ab1-80a0e382b847 0000:00:02.0 i915-GVTg_V4_8

Stop an mdev device (remove it, but it remains persistent):

# mdevctl stop-mdev ad8a4ad1-32cd-4cd4-8ab1-80a0e382b847

Start and mdev device we already know about:

# mdevctl start-mdev ad8a4ad1-32cd-4cd4-8ab1-80a0e382b847

List saved mdev devices:

# mdevctl list-saved
ad8a4ad1-32cd-4cd4-8ab1-80a0e382b847 0000:00:02.0 i915-GVTg_V4_8

Remove an mdev, stopping it if active:

# mdevctl remove-mdev ad8a4ad1-32cd-4cd4-8ab1-80a0e382b847

TODO
----
 * man page

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.