From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: Re: [PATCH V9 02/12] libxl_device: use async exec script api Date: Wed, 23 Apr 2014 16:48:46 +0100 Message-ID: <21335.57566.9179.445785@mariner.uk.xensource.com> References: <1397540297-32184-1-git-send-email-yanghy@cn.fujitsu.com> <1397540297-32184-3-git-send-email-yanghy@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1397540297-32184-3-git-send-email-yanghy@cn.fujitsu.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: Yang Hongyang Cc: ian.campbell@citrix.com, wency@cn.fujitsu.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, yunhong.jiang@intel.com, eddie.dong@intel.com, xen-devel@lists.xen.org, rshriram@cs.ubc.ca, roger.pau@citrix.com, laijs@cn.fujitsu.com List-Id: xen-devel@lists.xenproject.org Yang Hongyang writes ("[PATCH V9 02/12] libxl_device: use async exec script api"): > use async exec script api to exec device related scripts. Thanks. Most of this is the other half of the code motion from the previous patch. > - libxl__ev_child_init(&aodev->child); > + libxl__ev_child_init(&aodev->async_exec.child); You need an init function, to avoid a layering violation. The child field should be accessed only from the async exec implementation. > - assert(libxl__ev_child_inuse(&aodev->child)); > + assert(libxl__ev_child_inuse(&aodev->async_exec.child)); Likewise, you need an inuse function. > diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h > index eddafaf..cc8d558 100644 > --- a/tools/libxl/libxl_internal.h > +++ b/tools/libxl/libxl_internal.h > @@ -2094,7 +2094,9 @@ struct libxl__ao_device { > /* device hotplug execution */ > const char *what; > int num_exec; > - libxl__ev_child child; > + > + libxl__egc *egc; > + libxl_async_exec async_exec; I think this struct field name could profitably be shortened. Perhaps "exec" is too likely to clash but "aexec" would be OK. Thanks, Ian.