From: Ian Campbell Subject: Re: usage of libxl__sprintf for flexarray_append Date: Mon, 17 Mar 2014 09:24:21 +0000 Message-ID: <1395048261.4122.4.camel@kazak.uk.xensource.com> References: <20140317091555.GA10100@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140317091555.GA10100@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 2014-03-17 at 10:15 +0100, Olaf Hering wrote: > What is the reason for code like this in device_disk_add? > > flexarray_append(back, libxl__sprintf(gc, "%d", 1)); > > A few lines above a known value of 1 is written without sprintf, and > later cdrom/disk and r/w is also written as string. I think it's just a historic accident. Feel free to fix. If you are touching this stuff then IMHO the chains of flexarray_appends for key/value pairs should use flexarray_append_pair to make it clearer they are related, but perhaps that's a cleanup for another time. Ian.