* [PATCH] libxl: Call setsid(2) before exec'ing device model
@ 2011-03-08 2:55 Jim Fehlig
2011-03-10 18:19 ` Ian Jackson
0 siblings, 1 reply; 2+ messages in thread
From: Jim Fehlig @ 2011-03-08 2:55 UTC (permalink / raw)
To: xen-devel
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] libxl: Call setsid(2) before exec'ing device model
2011-03-08 2:55 [PATCH] libxl: Call setsid(2) before exec'ing device model Jim Fehlig
@ 2011-03-10 18:19 ` Ian Jackson
0 siblings, 0 replies; 2+ messages in thread
From: Ian Jackson @ 2011-03-10 18:19 UTC (permalink / raw)
To: Jim Fehlig; +Cc: xen-devel
Jim Fehlig writes ("[Xen-devel] [PATCH] libxl: Call setsid(2) before exec'ing device model"):
> 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.
Thanks, I think your patch is correct, and has the setsid in the right
place. libxl_spawn_spawn was another possibility but I think it's
probably better to do it in the caller.
Applied (with my and Stefano's ack) to 4.1 and unstable.
Ian.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-10 18:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-08 2:55 [PATCH] libxl: Call setsid(2) before exec'ing device model Jim Fehlig
2011-03-10 18:19 ` Ian Jackson
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.