aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/xen-pci.initd
blob: c06e89bb0a900714619d70c0a7b2f690542e2633 (plain)
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
#!/sbin/openrc-run

extra_commands="status"

depend() {
        need xenstored
        after xend xenconsoled
        before xendomains
}

is_running() {
        false
}

start() {
        if [ "${DEVICES}" != "" ]; then
                attached=$(xl pci-assignable-list)
                for x in ${DEVICES}; do
                        if echo "$attached" | grep -qsw "$x"; then
                          echo "PCI device $x already added - skipping"
                        else
                          echo "Adding PCI device $x to Xen"
                          xl pci-assignable-add $x
                        fi
                done
        else
                echo "DEVICES in /etc/conf.d/xen-pci is empty"
        fi
}

stop() {
	# do nothing devices may be in use
	true
}

status() {
        true
}