-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
95 lines (71 loc) · 2.81 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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