dom0/usb: added Big Fat Warning to qvm-usb tool (#664)
This commit is contained in:
parent
6bbd935df1
commit
62732d78b2
@ -26,6 +26,8 @@ from optparse import OptionParser
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
pvusb_enable_flagfile = '/var/lib/qubes/pvusb-enable.flag'
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
usage = "usage: %prog -l [options]\n"\
|
usage = "usage: %prog -l [options]\n"\
|
||||||
"usage: %prog -a [options] <vm-name> <device-vm-name>:<device>\n"\
|
"usage: %prog -a [options] <vm-name> <device-vm-name>:<device>\n"\
|
||||||
@ -46,6 +48,23 @@ def main():
|
|||||||
|
|
||||||
(options, args) = parser.parse_args ()
|
(options, args) = parser.parse_args ()
|
||||||
|
|
||||||
|
if not os.path.exists(pvusb_enable_flagfile):
|
||||||
|
print >> sys.stderr, ""
|
||||||
|
print >> sys.stderr, "******* WARNING *** WARNING *** WARNING *** WARNING *******"
|
||||||
|
print >> sys.stderr, "*** ***"
|
||||||
|
print >> sys.stderr, "*** PVUSB passthrough kernel support is still unstable. ***"
|
||||||
|
print >> sys.stderr, "*** It can CRASH your VMs ***"
|
||||||
|
print >> sys.stderr, "*** ***"
|
||||||
|
print >> sys.stderr, "***********************************************************"
|
||||||
|
print >> sys.stderr, ""
|
||||||
|
print >> sys.stderr, "If you still want to use it, type capital YES"
|
||||||
|
print >> sys.stderr, ""
|
||||||
|
prompt = raw_input ("Do you want enable PV USB support? ")
|
||||||
|
if prompt == "YES":
|
||||||
|
open(pvusb_enable_flagfile, "w").close()
|
||||||
|
else:
|
||||||
|
exit(1)
|
||||||
|
|
||||||
if os.geteuid() == 0:
|
if os.geteuid() == 0:
|
||||||
if not options.force_root:
|
if not options.force_root:
|
||||||
print >> sys.stderr, "*** Running this tool as root is strongly discouraged, this will lead you in permissions problems."
|
print >> sys.stderr, "*** Running this tool as root is strongly discouraged, this will lead you in permissions problems."
|
||||||
|
Loading…
Reference in New Issue
Block a user