From: Ian Jackson Subject: Re: [PATCH 2/2] libxl: fix stale timeout event callback race Date: Thu, 13 Dec 2012 15:51:11 +0000 Message-ID: <20681.63855.858383.346914@mariner.uk.xensource.com> References: <20678.5159.946248.90947@mariner.uk.xensource.com> <1355158624-11163-2-git-send-email-ian.jackson@eu.citrix.com> <50C7B974.4050706@suse.com> <20680.47971.962603.851882@mariner.uk.xensource.com> <50C8BE3F.4040402@suse.com> <20680.49391.646654.814456@mariner.uk.xensource.com> <50C8C665.2030202@suse.com> <20681.54029.391833.313611@mariner.uk.xensource.com> <50C9F711.400@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50C9F711.400@suse.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: Jim Fehlig Cc: "xen-devel@lists.xen.org" , Ian Campbell , Bamvor Jian Zhang List-Id: xen-devel@lists.xenproject.org Jim Fehlig writes ("Re: [Xen-devel] [PATCH 2/2] libxl: fix stale timeout event callback race"): > Yes, after thinking about it some more, I agree. > > As for the modify callback, do you agree that it is fine to ignore the > timeval parameter and just update the timer in libvirt's event loop to > fire immediately? I.e. always treat the timeval parameter as containing > {0,0} regardless of "old" or "new" libxl? Yes. That is fine. The reason is that old libxl doesn't ever call this function and new libxl always calls it with {0,0}. If you're worried about this, add an assertion :-). But it's theoretical. > I think my patch here is correct > http://lists.xen.org/archives/html/xen-devel/2012-12/msg00985.html Having thought about it, I agree, provided that you also fix the potential integer overflow in libxlTimeoutRegisterEventHook. > > Right. Well then yes you need to call virEventRemoveTimeout here. > > But that applies to both old and new libxl. > > Right. > > Thanks for the help with getting this issue resolved! Thank you and I'm sorry to have caused trouble with my inadequate analysis. Ian.