From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Fehlig Subject: [PATCH] libxl: Call setsid(2) before exec'ing device model Date: Mon, 07 Mar 2011 19:55:37 -0700 Message-ID: <4D759AA9.3030403@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030101080608040901040802" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------030101080608040901040802 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit While developing libvirt libxl driver I noticed that terminating the client causes any qemu-dm processes indirectly started by the client to also terminate. Calling setsid(2) before exec'ing qemu-dm resolves the issue but I'm not quite sure about the placement of the setsid() call or any unforeseen side-affects of its use. Comments welcome. Regards, Jim --------------030101080608040901040802 Content-Type: text/x-diff; name="libxl-qemu-dm-setsid.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="libxl-qemu-dm-setsid.patch" # HG changeset patch # User Jim Fehlig # Date 1299552244 25200 # Node ID 94fde77241912b634b492979ffc8cdb9516d6136 # Parent d8a65dd15d703ba302b0141e9ffe447ff1cd2a64 Call setsid(2) before exec'ing device model While doing development on libvirt libxenlight driver I noticed that terminating a libxenlight client causes any qemu-dm processes that were indirectly created by the client to also terminate. Calling setsid(2) before exec'ing qemu-dm resolves the issue. Signed-off-by: Jim Fehlig diff -r d8a65dd15d70 -r 94fde7724191 tools/libxl/libxl_dm.c --- a/tools/libxl/libxl_dm.c Thu Feb 17 11:21:47 2011 -0700 +++ b/tools/libxl/libxl_dm.c Mon Mar 07 19:44:04 2011 -0700 @@ -681,6 +681,7 @@ if (rc < 0) goto out_close; if (!rc) { /* inner child */ + setsid(); libxl__exec(null, logfile_w, logfile_w, libxl__abs_path(&gc, info->device_model, libxl_libexec_path()), args); --------------030101080608040901040802 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------030101080608040901040802--