From 62732d78b278a76a23b0e1e5e0ac4b6117fd1ddd Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Wed, 7 Nov 2012 22:02:28 +0100 Subject: [PATCH] dom0/usb: added Big Fat Warning to qvm-usb tool (#664) --- dom0/qvm-tools/qvm-usb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dom0/qvm-tools/qvm-usb b/dom0/qvm-tools/qvm-usb index 8b041b19..4649e275 100755 --- a/dom0/qvm-tools/qvm-usb +++ b/dom0/qvm-tools/qvm-usb @@ -26,6 +26,8 @@ from optparse import OptionParser import sys import os +pvusb_enable_flagfile = '/var/lib/qubes/pvusb-enable.flag' + def main(): usage = "usage: %prog -l [options]\n"\ "usage: %prog -a [options] :\n"\ @@ -46,6 +48,23 @@ def main(): (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 not options.force_root: print >> sys.stderr, "*** Running this tool as root is strongly discouraged, this will lead you in permissions problems."