From: Vincent Hanquez Subject: Re: [PATCH 14/14]: libxenlight, checks before device deletion and addition Date: Tue, 1 Dec 2009 06:30:27 +0000 Message-ID: <20091201062935.GE15791@gwig.uk.xensource.com> References: <4B141A7A.3090308@lagarcavilla.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <4B141A7A.3090308@lagarcavilla.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: Andres Lagar-Cavilla Cc: "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, Nov 30, 2009 at 07:18:18PM +0000, Andres Lagar-Cavilla wrote: > Proper existential checks before adding or deleting a > device, i.e. return error if: > > - Adding a device to a non-existent domain > - Adding a device twice > - Deleting a non-existent device > - Deleting a device from a non-existent domain > > Signed-off-by: Andres Lagar-Cavilla you should not check the non-existency of a domain. this is pointless since just after you check the domain might have gone away. also you might think of a mode where you populate the xenstore tree before creating the domain .. nobody does that, but I don't think there's any major stopper to do that or that it would be a bad idea either. Same reason that should it not check for device existency outside of the transaction, otherwise someome might have added it in the meantime. PS: please don't call libxl_free, that's really unnecessary at this stage, until we sort memory handling completly. (there's a "GC" for now) -- Vincent