libvirt-hotplug-usb 0.1.0

A daemon that watches Linux USB hot-plug events and passes matching devices through to a libvirt guest.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[Unit]
Description=Hot-plug matching USB devices into a libvirt guest
After=libvirtd.service
Wants=libvirtd.service

[Service]
Type=simple
# Adjust the domain and rules for your setup. Run as root (or a user with
# sufficient privileges to access libvirt's system socket and kernel uevents).
ExecStart=/usr/local/bin/libvirt-hotplug-usb \
    --connect qemu:///system \
    --domain myvm \
    --rule 'id=1234:abcd'
Restart=on-failure
RestartSec=2

[Install]
WantedBy=multi-user.target