From: Ian Jackson Subject: Re: [PATCH V7 3/7] libxl: add pvusb API Date: Thu, 8 Oct 2015 16:16:57 +0100 Message-ID: <22038.35049.922735.643817@mariner.uk.xensource.com> References: <1443147102-6471-1-git-send-email-cyliu@suse.com> <1443147102-6471-4-git-send-email-cyliu@suse.com> <22038.32910.375958.407732@mariner.uk.xensource.com> <1444316047.1410.220.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1444316047.1410.220.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: jgross@suse.com, wei.liu2@citrix.com, george.dunlap@eu.citrix.com, Chunyan Liu , xen-devel@lists.xen.org, jfehlig@suse.com, Simon Cao List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [PATCH V7 3/7] libxl: add pvusb API"): > Since this is part of a new "controller" abstraction we do in theory have > the freedom to do things differently, but it seems to me that having > something as basic as the list operation differ for devices vs. controller > would do more harm than good even if the controller interface is strictly > better. IOW I'm willing to be convinced otherwise but right now I'm pretty > sure how it is above is the preferable extension to our API. Hrm. OK, I guess :-/. > > > + tmp = READ_BACKEND(gc, "num-ports"); > > > + if (!tmp) goto outerr; > > > + usbctrl->ports = atoi(tmp); > > > > There are 4 nearly identical stanzas here. I think a more > > comprehensive would be helpful. Maybe a global macro READ_SUBPATH_INT > ^MACRO? Yes. Ian.