xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@suse.com>
To: libvir-list@redhat.com
Cc: Jim Fehlig <jfehlig@suse.com>, bjzhang@suse.com, xen-devel@lists.xen.org
Subject: [PATCH 4/4] libxl: improve subprocess handling
Date: Wed,  5 Feb 2014 10:39:46 -0700	[thread overview]
Message-ID: <1391621986-7341-5-git-send-email-jfehlig@suse.com> (raw)
In-Reply-To: <1391621986-7341-1-git-send-email-jfehlig@suse.com>

If available, let libxl handle reaping any children it creates by
specifying libxl_sigchld_owner_libxl_always_selective_reap.  This
feature was added to improve subprocess handling in libxl when used
in an application that does not install a SIGCHLD handler like
libvirt

http://lists.xen.org/archives/html/xen-devel/2014-01/msg01555.html

Prior to this patch, it is possible to hit asserts in libxl when
reaping subprocesses, particularly during simultaneous operations
on multiple domains.  With this patch, and the corresponding changes
to libxl, I no longer see the asserts.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---

The libxl patch has not yet hit xen.git, but without it this patch
has no semantic change, only explicitly setting chldowner to the
default of libxl_sigchld_owner_libxl.

 src/libxl/libxl_domain.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index fbd6cab..eb2e50e 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -358,6 +358,14 @@ virDomainDefParserConfig libxlDomainDefParserConfig = {
     .devicesPostParseCallback = libxlDomainDeviceDefPostParse,
 };
 
+static const libxl_childproc_hooks libxl_child_hooks = {
+#ifdef LIBXL_HAVE_SIGCHLD_OWNER_SELECTIVE_REAP
+    .chldowner = libxl_sigchld_owner_libxl_always_selective_reap,
+#else
+    .chldowner = libxl_sigchld_owner_libxl,
+#endif
+};
+
 int
 libxlDomainObjPrivateInitCtx(virDomainObjPtr vm)
 {
@@ -395,6 +403,7 @@ libxlDomainObjPrivateInitCtx(virDomainObjPtr vm)
     }
 
     libxl_osevent_register_hooks(priv->ctx, &libxl_event_callbacks, priv);
+    libxl_childproc_setmode(priv->ctx, &libxl_child_hooks, priv);
 
     ret = 0;
 
-- 
1.8.1.4

  parent reply	other threads:[~2014-02-05 17:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 17:39 [PATCH 0/4] libxl: fixes related to concurrency improvements Jim Fehlig
2014-02-05 17:39 ` [PATCH 1/4] libxl: fix leaking libxlDomainObjPrivate Jim Fehlig
2014-02-05 17:39 ` [PATCH 2/4] libxl: remove list of timer registrations from libxlDomainObjPrivate Jim Fehlig
2014-02-05 17:39 ` [PATCH 3/4] libxl: handle domain shutdown events in a thread Jim Fehlig
2014-02-06 12:53   ` [libvirt] " Michal Privoznik
2014-02-05 17:39 ` Jim Fehlig [this message]
2014-02-06 12:53 ` [libvirt] [PATCH 0/4] libxl: fixes related to concurrency improvements Michal Privoznik
     [not found] ` <52F385BE.5020509@redhat.com>
2014-02-06 17:36   ` Jim Fehlig

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=1391621986-7341-5-git-send-email-jfehlig@suse.com \
    --to=jfehlig@suse.com \
    --cc=bjzhang@suse.com \
    --cc=libvir-list@redhat.com \
    --cc=xen-devel@lists.xen.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).