[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] PV USB Use Case for Xen 4.x



Hi Ian

Sorry to be slow to respond.  I missed this e-mail when you sent it.  I
will try to get the information you are looking for.
On 08/16/2012 05:25 AM, Ian Campbell wrote:
> On Wed, 2012-08-15 at 18:07 +0100, Tom Parker wrote:
>> Good Afternoon.  My colleague Stefan (sstan) was asked on the IRC
>> channel to provide our use case for PV USB in our environment.  This
>> is possible with the current xm stack but not available with the xl
>> stack.
> Thanks for doing this.
>
> At first glance this doesn't seem like something which we could do for
> 4.2.0 at this stage, although we should do it for 4.3 and potentially
> consider it for 4.2.1.
>
> Is it something which you guys might be interested in providing patches
> for? It is at heart a moderately simple C coding exercise, I'm more than
> happy to provide guidance etc. Much of the generic framework already
> exists and there are examples in the form of other device types.
At this time we can't provide patches.  We are a sysadmin group and have
no programmers with experience in this.  It would take me a long time to
get back into C programming :)  Sorry.
>
>> Currently we use PVUSB to attach a USB Smartcard reader through our
>> dom0 (SLES 11 SP1) running on an HP Blade Server with the Token
>> mounted on an internal USB Port to our domU CA server (SLES 11)
>>
>> The config file syntax is broken so we have to manually attach (I have
>> it scripted) whenever our hosts reboot (which is almost never.)
> Can you give an example of what the syntax *should* be?
There used to be some data in the wiki or in an initial presentation on
PVUSB but as it has never worked for me.  I don't remember how it worked.
>
>> On the dom0 server I have to do the following steps:
>>
>> /usr/sbin/xm usb-list-assignable-devices (get the bus-id of the USB
>> device)
>> /usr/sbin/xm usb-hc-create $Domain 2 2 (Create a USB 2.0 Root Hub with
>> 2 ports in $Domain)
>> /usr/sbin/xm usb-attach $Domain $DevId $PortNumber $BusId (Attach the
>> USB bus-id found in step 1 to the hub created in step 2)
> What (if anything) is the output of these commands?
Nothing.  They return silently if there is no error.
>
> Do you need to do anything to make a device "assignable"? (I get no
> output from the list command for example)
You just have to have a device that is not attached anywhere else.   For
example:

mgaxen1:~ # xm usb-list-assignable-devices
6-1          : ID 03f0:1027 HP Virtual Keyboard

That means that for the xm usb-attach (/usr/sbin/xm usb-attach $Domain
$DevId $PortNumber $BusId) part I would use the 6-1 as the $BusId

>
>> On the domU the lsusb looks like this after the above (before it
>> returns nothing)
>>
>> mgaca:~ # lsusb 
>> Bus 001 Device 002: ID 04e6:5116 SCM Microsystems, Inc. SCR331-LC1
>> SmartCard Reader
>> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Can you post the output of "xenstore-ls -fp" while the device is
> connected?
This is the part of the output that refers to the the vusb:
/vm/99a002ad-7c36-4a40-b9f5-545770f2d1b2/device/vusb = ""   (n0)
/vm/99a002ad-7c36-4a40-b9f5-545770f2d1b2/device/vusb/0 = ""   (n0)
/vm/99a002ad-7c36-4a40-b9f5-545770f2d1b2/device/vusb/0/frontend =
"/local/domain/3/device/vusb/0"   (n0)
/vm/99a002ad-7c36-4a40-b9f5-545770f2d1b2/device/vusb/0/frontend-id =
"3"   (n0)
/vm/99a002ad-7c36-4a40-b9f5-545770f2d1b2/device/vusb/0/backend-id =
"0"   (n0)
/vm/99a002ad-7c36-4a40-b9f5-545770f2d1b2/device/vusb/0/backend =
"/local/domain/0/backend/vusb/3/0"   (n0)

The rest of the output I have attached as a file.
>
> Do you happen to know if this uses the PVUSB drivers or some other
> mechanism? "lsmod" in both dom0 and domU should provide a clue if the
> drivers are loaded.
Looks like it: 

dom0
mgaxen1:~ # lsmod | grep usb
usbbk                  23503  0
xenbus_be               3952  4 usbbk,netbk,blkbk,blktap
usbhid                 50900  0
hid                    83977  1 usbhid
usbcore               221920  5 usbbk,usbhid,uhci_hcd,ehci_hcd

domU
mgaca:~ # lsmod | grep usb
usbcore               220777  3 xen_hcd
>
> Does this work for both PV and HVM guests or do you only use one or the
> other?
I only use PV guests.
>
>> Once I have done this I can use the usb devce in the domU as if it was
>> directly connected. 
>>
>> Thanks for your time.
> Thank you for describing the functionality.
>
> Ian.
>
>

Attachment: xenstore-ls.fp.out
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.