From: Ian Jackson Subject: Re: [PATCH 07/13] libxl: convert libxl_domain_destroy to an AO op Date: Fri, 18 May 2012 17:24:20 +0100 Message-ID: <20406.30644.534400.44681@mariner.uk.xensource.com> References: <1337184716-49276-1-git-send-email-roger.pau@citrix.com> <1337184716-49276-8-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1337184716-49276-8-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Roger Pau Monne writes ("[PATCH 07/13] libxl: convert libxl_domain_destroy to an AO op"): > +struct libxl__ao_device { > + libxl__ao *ao; > + /* State in which the device is */ > + libxl__device_state state; > + /* action being performed */ > + libxl__device_action action; > + libxl__device *dev; > + int force; > + libxl__device_callback *callback; > + /* private for implementation */ > + int rc; > + libxl__ev_devstate ds; > + void *base; > +}; Perhaps this new functionality could be in a separate patch too ? I guess it won't share a great deal of code with the existing machinery. > +/*----- device addition/removal -----*/ > + > +/* During the init/destruction process, the device can be in several states: > + * > + * DEVICE_UNKNOWN: device in unknown state (default value when struct is > + * initialized). > + * > + * DEVICE_WAIT_BACKEND: waiting for the backend to switch to XenbusStateInit or > + * XenbusStateClosed. > + * > + * DEVICE_WAIT_HOTPLUG: waiting for hotplug script to finish execution. > + * > + * DEVICE_FINISHED: device is connected/disconnected. > + */ > +typedef enum { > + DEVICE_ACTIVE, > + DEVICE_FINISHED > +} libxl__device_state; This enum doesn't seem to correspond to the comment. Also if it really is a two-state enum why not just have a boolean called "finished" ? Ian.