From 158ac0bd6a5c6e4b508fbe3c6fabe192c7b4ba88 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 23 Oct 2012 05:42:39 +0200 Subject: [PATCH] dom+vm/qvm-usb: improve handling devices like "2-1.4" xenstore doesn't allow '.' in key name, so translate it to '_' --- misc/usb_add_change | 3 ++- misc/usb_remove | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/usb_add_change b/misc/usb_add_change index a265900..4440475 100755 --- a/misc/usb_add_change +++ b/misc/usb_add_change @@ -12,7 +12,8 @@ [ "$DEVNUM" = "001" ] && exit 0 [ "$DEVTYPE" != "usb_device" ] && exit 0 -NAME=`basename ${DEVPATH}` +# xenstore doesn't allow dot in key name +NAME=`basename ${DEVPATH} | tr . _` # FIXME: For some devices (my Cherry keyboard) ID_SERIAL does not # contain proper human-readable name, should find better method to # build devide description. diff --git a/misc/usb_remove b/misc/usb_remove index 926dc6f..f7f33ed 100755 --- a/misc/usb_remove +++ b/misc/usb_remove @@ -3,7 +3,7 @@ # FIXME: Ignore USB hubs. [ "$DEVNUM" = "001" ] && exit 0 -NAME=`basename ${DEVPATH}` +NAME=`basename ${DEVPATH} | tr . _` XS_KEY="qubes-usb-devices/$NAME" xenstore-rm "$XS_KEY"