From: Ian Jackson Subject: Re: [PATCH,RFC]: Introduce libxl_domain_create() Date: Tue, 21 Dec 2010 11:35:40 +0000 Message-ID: <19728.37132.470936.457946@mariner.uk.xensource.com> References: <1292353212.11246.35.camel@qabil.uk.xensource.com> <1292576770.32368.11405.camel@zakaz.uk.xensource.com> <1292921096.11246.55.camel@qabil.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1292921096.11246.55.camel@qabil.uk.xensource.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: Gianni Tedesco Cc: Ian Campbell , Xen Devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Gianni Tedesco writes ("Re: [Xen-devel] [PATCH,RFC]: Introduce libxl_domain_create()"): > On Fri, 2010-12-17 at 09:06 +0000, Ian Campbell wrote: > > Should be in IDL so it gets a destructor? Could require adding an Array > > construct to handle the foo + num_foo style stuff. > > I've thought about that and rejected it because C arrays don't map to > anything useful in language bindings. It makes sense to me to keep this > as a builtin and use functions to fill these domain creation related > structures in for us. Arrays map perfectly well to a C pointer and a length. If you want to do automatic expansion you need a separate allocated length too, which is probably worthwhile. > But then what you get is like two versions of: > - libxl_device_add_(nic|block|etc) > One for a live domain and one for domain creation. I think that's fine, particularly if they take the same struct. > I have been toying with the idea of using polymorphism (is that what > it's called?) So that such a function would multiplex to different > implementations depending on whether this is a live domain or a > description of a domain for creation. It might need a bit of thinking > through as how it would be used. Urgh. Ian.