From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 6/6] libxl: events: Document and enforce actual callbacks restriction Date: Fri, 28 Nov 2014 13:04:56 +0000 Message-ID: <1417179896.23604.42.camel@citrix.com> References: <1417083745.12784.1.camel@citrix.com> <1417112870-31894-1-git-send-email-ian.jackson@eu.citrix.com> <1417112870-31894-7-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1417112870-31894-7-git-send-email-ian.jackson@eu.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: Ian Jackson Cc: Jim Fehlig , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Thu, 2014-11-27 at 18:27 +0000, Ian Jackson wrote: > libxl_event_register_callbacks cannot reasonably be called while libxl > is busy (has outstanding operations and/or enabled events). > > This is because the previous spec implied (although not entirely > clearly) that event hooks would not be called for existing fd and > timeout interests. There is thus no way to reliably ensure that libxl > would get told about fds and timeouts which it became interested in > beforehand. > > So there have to be no such fds or timeouts, which means that the > callbacks must only be registered or changed when the ctx is idle. > > Document this restriction, and enforce it with a pair of asserts. > > (It would be nicer, perhaps, to say that the application may not call > libxl_osevent_register_hooks other than right after creating the ctx. > But there are existing callers, including libvirt, who do it later - > even after doing major operations such as domain creation.) > > Signed-off-by: Ian Jackson Acked-by: Ian Campbell