From: Ian Campbell Subject: Re: [PATCH] Fix assignment of devid value returned from libxl__device_nextid Date: Wed, 26 Jun 2013 17:49:34 +0100 Message-ID: <1372265374.7337.111.camel@zakaz.uk.xensource.com> References: <1372197735-5094-1-git-send-email-jfehlig@suse.com> <51CB19D8.6040400@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51CB19D8.6040400@suse.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: Jim Fehlig Cc: George Dunlap , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Wed, 2013-06-26 at 10:42 -0600, Jim Fehlig wrote: > George Dunlap wrote: > > On Tue, Jun 25, 2013 at 11:02 PM, Jim Fehlig wrote: > > > >> Commit 5420f265 has some misplaced parenthesis that caused devid > >> to be assigned 1 or 0 based on checking return value of > >> libxl__device_nextid < 0, e.g. > >> > >> devid = libxl__device_nextid(...) < 0 > >> > >> This works when only one instance of a given device type exists, but > >> subsequent devices of the same type will also have a devid = 1 if > >> libxl__device_nextid succeeds. Fix by checking the value assigned to > >> devid, e.g. > >> > >> (devid = libxl__device_nextid(...)) < 0 > >> > >> Signed-off-by: Jim Fehlig > >> > > > > Both for 4.3, and as a patch in general: > > > > Noticed I have the commit msg a tad bit wrong. It should read > "...devices of the same type will also have a devid = 0 if..." since > libxl__device_nextid(...) < 0 is false when libxl__device_nextid() > succeeds. Also, perhaps I should add that xl is not affected since it > supplies devid, but apps such as libvirt that allow libxl to fill in > devid are certainly affected when there is more than 1 of the same > device type. Should I submit a V2 with an improved commit msg? I'm afraid I have already committed. Not to worry. Ian.