All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@novell.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] libxl: Call setsid(2) before exec'ing device model
Date: Mon, 07 Mar 2011 19:55:37 -0700	[thread overview]
Message-ID: <4D759AA9.3030403@novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 360 bytes --]

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


[-- Attachment #2: libxl-qemu-dm-setsid.patch --]
[-- Type: text/x-diff, Size: 995 bytes --]

# HG changeset patch
# User Jim Fehlig <jfehlig@novell.com>
# 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 <jfehlig@novell.com>

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);

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2011-03-08  2:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08  2:55 Jim Fehlig [this message]
2011-03-10 18:19 ` [PATCH] libxl: Call setsid(2) before exec'ing device model Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D759AA9.3030403@novell.com \
    --to=jfehlig@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.