RFC xl/libxl support for PVUSB
Get series with b4
b4 am [email protected]Versions newest first
- v0 RFC Latest2 patches 9 repliesIn review
Patches in v0 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | libxl: Introduce functions in libxl to add and remove USB devices for an PV guesttools/ tools/ tools/ +5 more | +1474 | 2 replies | |
| 2/2 | xl: Add commands for usb hot-plugtools/ tools/ tools/ | +359 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v0 yet.
Cover letter [PATCH v0 RFC 0/2] xl/libxl support for PVUSB
Finally I have a workable version xl/libxl support for PVUSB. Most of its commands work property now, but there are still some probelm to be solved. Please take a loot and give me some advices.
== What have been implemented ? ==
I have implemented libxl functions for PVUSB in libxl_usb.c. It mainly consists of two part:
usbctrl_add/remove/list and usb_add/remove/list in which usbctrl denote usb controller in which usd device can be plugged in. I don't use "ao_dev" in libxl_deivce_usbctrl_add since we don't need to execute hotplug script for usbctrl and without "ao_dev", adding default usbctrl for usb device would be easier.
For the cammands to manipulate usb device such as "xl usb-attach" and "xl usb-detach", this patch now only support to specify usb devices by their interface in sysfs. Using this interface, we can read usb device information through sysfs and bind/unbind usb device. (The support for mapping the "lsusb" bus:addr to the sysfs usb interface will come later).
== What needs to do next ? ==
There are two main problems to be solved.
1. PVUSB Options in VM Guest's Configuration File
The interface in VM Guest's configuration file to add usb device is: "usb=[interface="1-1"]".
But the problem is now is that after the default usbctrl is added, the state of usbctrl is "2", e,g, "XenbusStateInitWait", waiting for xen-usbfront to connect. The xen-usbfront in VM Guest isn't loaded. Therefore, "sysfs_intf_write" will report error. Does anyone have any clue how to solve this?
2. sysfs_intf_write
In the process of "xl usb-attach domid intf=1-1", after writing "1-1" to Xenstore entry, we need to
bind the controller of this usb device to usbback driver so that it can be used by VM Guest. For exampele, for usb device "1-1", it's controller interface maybe "1-1:1.0", and we write this value to "/sys/bus/usb/driver/usbback/bind". But for some devices, they have two controllers, for example "1-1:1.0" and "1-1:1.1". I think this means it has two functions, such as usbhid and usb-storage. So in this case, we bind the two controller to usbback?
========
There maybe some errors or bugs in the codes. Feel free to tell me.
Cheers,
- Simon
---
CC: George Dunlap <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Pasi Kärkkäinen <[email protected]>
CC: Lars Kurth <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel