From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v6 2/2] xl: Add commands for usb hot-plug Date: Thu, 25 Apr 2013 14:48:41 +0100 Message-ID: <51793439.7050606@eu.citrix.com> References: <1366387166-21197-1-git-send-email-george.dunlap@eu.citrix.com> <1366387166-21197-2-git-send-email-george.dunlap@eu.citrix.com> <1366807503.20256.333.camel@zakaz.uk.xensource.com> <51790282.8090903@eu.citrix.com> <1366889888.20256.514.camel@zakaz.uk.xensource.com> <51791A3E.1080801@eu.citrix.com> <20130425134252.GP11427@reaktio.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20130425134252.GP11427@reaktio.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= Cc: "sstanisi@cbnco.com" , "xen-devel@lists.xen.org" , Ian Jackson , Ian Campbell , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org On 04/25/2013 02:42 PM, Pasi K=E4rkk=E4inen wrote: > On Thu, Apr 25, 2013 at 12:57:50PM +0100, George Dunlap wrote: >> On 04/25/2013 12:38 PM, Ian Campbell wrote: >>> On Thu, 2013-04-25 at 11:16 +0100, George Dunlap wrote: >>>>>> + for (i =3D 0; i < num; i++) { >>>>>> + printf("%8s ", (dev[i].protocol=3D=3DLIBXL_USB_PROTOCOL_PV= )?"pv":"dm"); >>>>> >>>>> You can use libxl_usb_protocol_to_string here. >>>> >>>> Could do, but I didn't necessarily want the long version ("devicemodel= "). >>> >>> TBH the more I think about it the more I think DM/DEVICEMODEL in this >>> interface is leaking an implementation detail, after all the user >>> doesn't really care who/what is emulating a USB controller. >>> >>> Protocol =3D {PV,OHCI,XHCI}? >> >> As we covered before: >> >> 1. I have no way of selecting OHCI vs XHCI at this point >> > > https://github.com/qemu/qemu/blob/master/docs/usb2.txt > > qemu -device usb-ehci,id=3Dehci \ > -device usb-tablet,bus=3Dusb-bus.0 \ > -device usb-storage,bus=3Dehci.0,drive=3Dusbstick > > "This attaches a usb tablet to the UHCI adapter and a usb mass storage > device to the EHCI adapter." > > > http://lists.gnu.org/archive/html/qemu-devel/2012-05/msg04013.html > qemu $args -device nec-usb-xhci,id=3Dxhci -device usb-tablet,bus=3Dxhci.0 > > http://www.linux-kvm.com/content/qemu-kvm-11-adds-experimental-support-us= b-30 > qemu-kvm -device nec-usb-xhci,id=3Dxhci -device usb-storage,bus=3Dxhci.0,= drive=3Dusbstick > > > So it seems it's possible to create ehci/usb2.0 and xhci/usb3.0 controlle= rs as needed, > and attach devices to both of them by specifying the virtual bus.. > > > >> 2. Even if I did, why should the caller have to keep track of what >> kind of USB hardware is exposed to the guest? They should be able >> to just say "Add" and have stuff sorted out. >> > > Compatibility might be one reason why users want to specify specific virt= ual controller.. > ie. some usb 2.0 devices don't work properly in usb 3.0 controllers, unfo= rtunately.. I'll take a look at implementing some of this when I come back to this = series after the 4.3 release. But it seems like having a "controller = type" option in the device field might be useful. We should also look and see what libvirt exposes, at least for KVM, to = get an idea what kinds of things might be useful to implement. -George