From: Ewan Mellor Subject: Re: [PATCH][libxen] Fix 'contents' field of set structures in libxen iinterface Date: Wed, 8 Nov 2006 15:09:32 +0000 Message-ID: <20061108150932.GD3507@leeni.uk.xensource.com> References: <454BE1BB.7050000@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <454BE1BB.7050000@novell.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: Jim Fehlig Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Fri, Nov 03, 2006 at 05:41:31PM -0700, Jim Fehlig wrote: > Many of the set structures in the libxen interface contain a 'contents' > field with too many dimensions, particularly when 'contents' stores > references. References are defined in the various xen_*_decl.h headers > as 'void *'. Sets of the various classes are defined for example as > > typedef void *xen_vm; > > typedef struct xen_vm_set > { > size_t size; > xen_vm *contents[]; > } xen_vm_set; > > The additional dimension on 'contents' for sets of references is not > required. > I meant to discuss this with you when you sent this privately a few weeks ago -- sorry I forgot. I can see what you're trying to do here. The problem is that populating this set becomes difficult. The sets are read off the wire using the generic code in xen_common.c, guided by the abstract_type that's passed in. The thing is, we have only one indicator for sets (SET) but with your patch we'll need to introduce a second indicator, to distinguish between sets where the value is put in place (like handles) and sets where the value placed is a pointer (like sets of records). This will have to be part of a larger patch, unfortunately. I'll have a hack now and see what I can do. Cheers, Ewan.