Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-06-11 Thread Ian Jackson
Wei Liu writes ("Re: [PATCH V3 3/6] libxl: add pvusb API"): > On Mon, May 18, 2015 at 09:20:43PM -0600, Chun Yan Liu wrote: > > Thanks, I'm updating that. But maybe like pci_add and pci_remove functions, > > will add a 'starting' flag to indicate hotplug or creation. > > Looking at DEFINE_DEVICE_AD

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-20 Thread Chun Yan Liu
>>> On 5/20/2015 at 05:04 PM, in message <20150520090407.gw26...@zion.uk.xensource.com>, Wei Liu wrote: > On Mon, May 18, 2015 at 09:20:43PM -0600, Chun Yan Liu wrote: > [...] > > > > > > > +for (;;) { > > > > +rc = libxl__xs_transaction_start(gc, &t); > > > > +if (

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-20 Thread Ian Campbell
On Wed, 2015-05-20 at 10:04 +0100, Wei Liu wrote: > On Mon, May 18, 2015 at 09:20:43PM -0600, Chun Yan Liu wrote: > [...] > > > > > > > +for (;;) { > > > > +rc = libxl__xs_transaction_start(gc, &t); > > > > +if (rc) goto out; > > > > + > > > > +rc = libxl__device_e

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-20 Thread Wei Liu
On Mon, May 18, 2015 at 09:20:43PM -0600, Chun Yan Liu wrote: [...] > > > > > +for (;;) { > > > +rc = libxl__xs_transaction_start(gc, &t); > > > +if (rc) goto out; > > > + > > > +rc = libxl__device_exists(gc, t, device); > > > +if (rc < 0) goto out; > > >

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-19 Thread Ian Campbell
On Tue, 2015-05-19 at 19:06 +0100, George Dunlap wrote: > > diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h > > index 6bc75c5..cbe3519 100644 > > --- a/tools/libxl/libxl.h > > +++ b/tools/libxl/libxl.h > > @@ -114,6 +114,12 @@ > > #define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1 > > > > /* > > + *

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-19 Thread George Dunlap
On Sun, Apr 19, 2015 at 4:50 AM, Chunyan Liu wrote: > +int libxl_device_usbctrl_getinfo(libxl_ctx *ctx, uint32_t domid, > +libxl_device_usbctrl *usbctrl, > +libxl_usbctrlinfo *usbctrlinfo) > +{ > +GC_INIT(ctx); > +char *dompat

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-19 Thread George Dunlap
On Sun, Apr 19, 2015 at 4:50 AM, Chunyan Liu wrote: > +int libxl_device_usb_getinfo(libxl_ctx *ctx, char *busid, libxl_usbinfo > *usbinfo) > +{ Sorry, missed something. This function is wrong. It gives you information about a *host* USB device; but should properly give you information about a

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-19 Thread George Dunlap
On Sun, Apr 19, 2015 at 4:50 AM, Chunyan Liu wrote: > Add pvusb APIs, including: > - attach/detach (create/destroy) virtual usb controller. > - attach/detach usb device > - list usb controller and usb devices > - some other helper functions > > Signed-off-by: Chunyan Liu > Signed-off-by: Simo

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-19 Thread Jürgen Groß
On 05/19/2015 12:20 PM, George Dunlap wrote: On Tue, May 19, 2015 at 4:20 AM, Chun Yan Liu wrote: +static int libxl__device_usbctrl_setdefault(libxl__gc *gc, uint32_t domid, +libxl_device_usbctrl *usbctrl) +{ +int rc; + +if (!usbctrl->versio

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-19 Thread George Dunlap
On Tue, May 19, 2015 at 4:20 AM, Chun Yan Liu wrote: >> >> > +static int libxl__device_usbctrl_setdefault(libxl__gc *gc, uint32_t domid, >> > +libxl_device_usbctrl *usbctrl) >> > +{ >> > +int rc; >> > + >> > +if (!usbctrl->version) >> > +

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-18 Thread Chun Yan Liu
>>> On 5/19/2015 at 02:07 AM, in message <20150518180724.gh9...@zion.uk.xensource.com>, Wei Liu wrote: > (I look at overall code structure this pass. I haven't done a line by > line review.) > > On Sun, Apr 19, 2015 at 11:50:49AM +0800, Chunyan Liu wrote: > > Add pvusb APIs, including: >

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-18 Thread Wei Liu
(I look at overall code structure this pass. I haven't done a line by line review.) On Sun, Apr 19, 2015 at 11:50:49AM +0800, Chunyan Liu wrote: > Add pvusb APIs, including: > - attach/detach (create/destroy) virtual usb controller. > - attach/detach usb device > - list usb controller and usb d

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-05-18 Thread Olaf Hering
On Sun, Apr 19, Chunyan Liu wrote: > +static int libxl__usbctrl_add_xenstore(libxl__gc *gc, uint32_t domid, > + libxl_device_usbctrl *usbctrl) > +{ > +flexarray_append_pair(back, "state", "1"); > +flexarray_append_pair(front, "state", "1"); This (an

Re: [Xen-devel] [PATCH V3 3/6] libxl: add pvusb API

2015-04-19 Thread Juergen Gross
On 04/19/2015 05:50 AM, Chunyan Liu wrote: Add pvusb APIs, including: - attach/detach (create/destroy) virtual usb controller. - attach/detach usb device - list usb controller and usb devices - some other helper functions Signed-off-by: Chunyan Liu Signed-off-by: Simon Cao --- Changes