From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 00 of 23] libxl: improved handling for default values in API Date: Mon, 13 Feb 2012 16:52:46 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org Introduce a mechanism for users of libxl to explicitly say "pick the default for me". To do this each field has a distinguished "init_val" and each struct has a "_setdefault" method which sets (idempotently) the defaults for fields which have not been set to an explicit value. Previously I went through some contortions (with "timer_mode" in particular but also with *_memkb fields) to try and arrange that this distinguished value was the all zeroes bit pattern. Instead of that pain this time I have arranged that the IDL supports the specification the distinguished val for each type/field and we autogenerate an _init function for each data type based on that. Changes since last time: * I have posted large parts of the previous series as * libxl: drop device_model_info * libxl: API updates + xl: JSON These have been committed thereby reducing the size of this series. * _init function support as described above * Dropped final patch to actually select stubdoms when possible -- this needs more investigation/sanity checking. This series has been lightly tested with PV domains (with and without PVFB) and HVM domains (with and without stubdom).