From: "Chun Yan Liu" Subject: Re: [PATCH RFC V2 4/5] xl: add pvusb commands Date: Fri, 20 Mar 2015 03:02:09 -0600 Message-ID: <550C529102000066000ADCAD@relay2.provo.novell.com> References: <1421656131-19366-1-git-send-email-cyliu@suse.com> <1421656131-19366-5-git-send-email-cyliu@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Ian Jackson , Simon Cao , "xen-devel@lists.xen.org" , Ian Campbell , Lars Kurth List-Id: xen-devel@lists.xenproject.org >>> On 3/7/2015 at 01:25 AM, in message , George Dunlap wrote: > On Mon, Jan 19, 2015 at 8:28 AM, Chunyan Liu wrote: > > Add pvusb commands. > > > > To attach a usb device to guest through pvusb, one could follow > > following example: > > > > #xl usb-ctrl-attach test_vm version=1 num_ports=8 > > This doesn't allow you to specify controller name or devid. > > I was looking at the other device-attach code, and they all seem to > have a "devicespec"-style specification. Would it make sense to do > something similar? > > For example: > > xl usb-ctrl-attach test_vm name=pv-1,type=pv,version=1,ports=8 > > Then we could re-use this for the config file as well. > > > #xl usb-list test_vm > > will show the usb controllers and port usage under the domain. > > > > #xl usb-assignable-list > > will list all assignable usb devices now in host, with their > > sysfs interface. (This is very useful since later we will use > > sysfs interface to attach a usb devie to guest) > > > > #xl usb-attach test_vm 2-1.1 > > will find the first usable controller:port, and attach usb > > device with sysfs interface 2-1.1 (sys/bus/usb/devices/2-1.1) > > to it. One could also specify which and which > > > > #xl usb-detach test_vm 2-1.1 > > Long-term we want to be able to attach and detach more kinds of > devices than just host devices; for example for HVM guests we want to > be able to attach mice, keyboards, tablets, &c. > > What if we continued with the "devicespec" idea above, it might make > more sense to say something like > > xl usb-attach test_vm type=hostdev,hostbus=X,hostaddr=Y,ctrl=pv-1 > > (Assuming you had a controller named pv-1, for example.) > > And then maybe in the future we could have something like > > xl usb-attach test_vm type=tablet > > Thoughts? This could be. I can update. > > -George > >