From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Pau Monne Subject: Re: [PATCH v4 08/10] libxl: call hotplug scripts for disk devices from libxl Date: Wed, 30 May 2012 12:33:34 +0100 Message-ID: <4FC6058E.8080007@citrix.com> References: <1337855045-10428-1-git-send-email-roger.pau@citrix.com> <1337855045-10428-9-git-send-email-roger.pau@citrix.com> <20420.57899.741924.469693@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20420.57899.741924.469693@mariner.uk.xensource.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: Ian Jackson Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Jackson wrote: >> + return; >> + >> +out: >> + libxl__ev_time_deregister(gc,&aodev->ev); >> + aodev->rc = rc; >> + aodev->callback(egc, aodev); >> + return; >> +} > > Shouldn't something set aodev->state to FINISHED in this error path ? > > It might be better to have a helper function to call when declaring > the aodev finished. That helper function would also do the > _ev_time_deregister, and assert !libxl__ev_child_inuse. Setting the aodev to finished is always done in libxl__ao_device_check_last, which should be called by the user. > >> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h >> index 45b776c..da5b02b 100644 >> --- a/tools/libxl/libxl_internal.h >> +++ b/tools/libxl/libxl_internal.h > ... >> + /* device hotplug execution */ >> + pid_t pid; >> + char *what; >> + libxl__ev_time ev; >> + libxl__ev_child child; > > Is the pid inside child not sufficient ? Probably, I just wasn't sure if the user of libxl__ev_child was allowed to pick values inside the struct, now I saw the comment :)