From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincent Hanquez Subject: Re: [PATCH 3/4] libxl: add version_info function [and 1 more messages] Date: Wed, 21 Apr 2010 13:53:43 +0100 Message-ID: <4BCEF557.4050308@eu.citrix.com> References: <4BCB76FD.1020103@amd.com> <4BCB791E.7000204@amd.com> <4BCC0F86.8090707@eu.citrix.com> <19404.30856.176804.871256@mariner.uk.xensource.com> <4BCCC062.5080008@amd.com> <4BCD6775.7060800@eu.citrix.com> <4BCEEB43.8090406@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4BCEEB43.8090406@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Andre Przywara Cc: "xen-devel@lists.xensource.com" , Ian Jackson , Keir Fraser , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 21/04/10 13:10, Andre Przywara wrote: > I just wanted to avoid introducing a lot of functions which could be > actually one. And if a user passes a wrong mask, then well, he is just > doing the wrong thing and cannot expect it to work. If Xen provides a > possibility to query single parts of the information, why should we hide > this capability from the upper layers? well that's just for simplicity. > But when I was looking at the libxl_sprintf thing, I realized that all > the information in the info structure is static and will never change > during runtime. Am I right? If so, we can solve this whole thing by not > only storing the strings in libxl_ctx, but the whole structure. The > first call to the function would query all the members, subsequent calls > would just return the pointer. This avoids duplication should the > function be called multiple times. It would be automatically freed when > destroying the xl context. > > What do you think of this? I think that's quite reasonable and a good idea all in all. the API stays simple, and most potential performance issues are just dealt with. -- Vincent