From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 26/29] libxl: cancellation: Handle SIGTERM in save/restore helper Date: Tue, 24 Mar 2015 12:07:41 +0000 Message-ID: <1427198861.21742.374.camel@citrix.com> References: <1423599016-32639-1-git-send-email-ian.jackson@eu.citrix.com> <1423599016-32639-27-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: <1423599016-32639-27-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: xen-devel@lists.xensource.com, Euan Harris List-Id: xen-devel@lists.xenproject.org On Tue, 2015-02-10 at 20:10 +0000, Ian Jackson wrote: > During startup of the save/restore helper, set the disposition of > SIGTERM appropriately. > > For restore, we can simply die immediately - there is no point trying > to do any kind of cleanup on what is now going to be a trashed domain. > > For save, we want to arrange that libxc's cleanup code (eg turning off > logdirty) takes place. So our signal handler replaces the fd with one > on which writes will fail, causing libxc's own loop to fail next time > it actually tries to do a write. > > Currently this has only a minor beneficial effect: we don't send the > helper a SIGTERM ourselves, and if someone else contrives to send our > helper a SIGTERM they have probably sent one to libxl too in which > case things are going to be a bit messy anyway. > > But in the next patch libxl is going to use SIGTERM itself on ao > cancellation. > > Signed-off-by: Ian Jackson Acked-by: Ian Campbell