dom0+vm/qvm-usb: added vusb helper script to usbvm
This commit is contained in:
parent
f2dc86b2f1
commit
88c446c6f3
@ -8,7 +8,7 @@
|
||||
# Copy files
|
||||
cp misc/usb_add_change /usr/lib/qubes/usb_add_change
|
||||
cp misc/usb_remove /usr/lib/qubes/usb_remove
|
||||
# FIXME cp misc/xen-vusb-helper.py /usr/lib/qubes/xen-vusb-helper.py
|
||||
cp misc/misc/vusb-ctl.py /usr/lib/qubes/misc/vusb-ctl.py
|
||||
cp misc/qubes_usb.rules /etc/udev/rules.d/99-qubes_usb.rules
|
||||
|
||||
# Reload PVUSB backend and cleanup xenstore
|
||||
|
24
misc/vusb-ctl.py
Executable file
24
misc/vusb-ctl.py
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
##
|
||||
## Python script wrapper around xen.util.vusb_util bind_usb_device() and unbind_usb_device() methods
|
||||
## Run as root in usbvm
|
||||
##
|
||||
|
||||
from xen.util import vusb_util
|
||||
import sys
|
||||
import os
|
||||
|
||||
if len(sys.argv)!=3:
|
||||
print 'usage: vusb-ctl <bind|unbind> device'
|
||||
sys.exit(1)
|
||||
|
||||
device=sys.argv[2]
|
||||
if sys.argv[1] == 'bind':
|
||||
vusb_util.bind_usb_device(device)
|
||||
elif sys.argv[1] == 'ubind':
|
||||
vusb_util.unbind_usb_device(device)
|
||||
else
|
||||
print "Invalid command, must be 'bind' or 'unbind'"
|
||||
sys.exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user