qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [Qemu-devel] [PATCH 8/9] docker: Terminate instances at SIGTERM and SIGHUP
Date: Wed, 21 Sep 2016 09:42:43 +0100	[thread overview]
Message-ID: <20160921084243.GI15535@redhat.com> (raw)
In-Reply-To: <1474429768-25027-9-git-send-email-famz@redhat.com>

On Wed, Sep 21, 2016 at 11:49:27AM +0800, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  tests/docker/docker.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/docker/docker.py b/tests/docker/docker.py
> index b85c165..552608e 100755
> --- a/tests/docker/docker.py
> +++ b/tests/docker/docker.py
> @@ -21,6 +21,7 @@ import uuid
>  import argparse
>  import tempfile
>  import re
> +import signal
>  from tarfile import TarFile, TarInfo
>  from StringIO import StringIO
>  from shutil import copy, rmtree
> @@ -98,6 +99,8 @@ class Docker(object):
>          self._command = _guess_docker_command()
>          self._instances = []
>          atexit.register(self._kill_instances)
> +        signal.signal(signal.SIGTERM, self._kill_instances)
> +        signal.signal(signal.SIGHUP, self._kill_instances)
>  
>      def _do(self, cmd, quiet=True, infile=None, **kwargs):
>          if quiet:
> @@ -130,7 +133,7 @@ class Docker(object):
>          self._do_kill_instances(False, False)
>          return 0
>  
> -    def _kill_instances(self):
> +    def _kill_instances(self, *args, **kwargs):
>          return self._do_kill_instances(True)
>  
>      def _output(self, cmd, **kwargs):

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  reply	other threads:[~2016-09-21  8:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21  3:49 [Qemu-devel] [PATCH 0/9] docker: SHOW_ENV and terminate improvements Fam Zheng
2016-09-21  3:49 ` [Qemu-devel] [PATCH 1/9] docker: Generate /packages.txt in centos6 image Fam Zheng
2016-09-21  8:37   ` Daniel P. Berrange
2016-09-21  3:49 ` [Qemu-devel] [PATCH 2/9] docker: Generate /packages.txt in fedora image Fam Zheng
2016-09-21  8:38   ` Daniel P. Berrange
2016-09-21  3:49 ` [Qemu-devel] [PATCH 3/9] docker: Generate /packages.txt in ubuntu image Fam Zheng
2016-09-21  8:39   ` Daniel P. Berrange
2016-09-21  3:49 ` [Qemu-devel] [PATCH 4/9] docker: Update fedora image to latest Fam Zheng
2016-09-21  8:39   ` Daniel P. Berrange
2016-09-21  3:49 ` [Qemu-devel] [PATCH 5/9] docker: Flatten default target list in test-quick Fam Zheng
2016-09-21  8:40   ` Daniel P. Berrange
2016-09-21  3:49 ` [Qemu-devel] [PATCH 6/9] docker: Print used options before doing configure Fam Zheng
2016-09-21  8:41   ` Daniel P. Berrange
2016-09-21  3:49 ` [Qemu-devel] [PATCH 7/9] docker: Support showing environment information Fam Zheng
2016-09-21  8:42   ` Daniel P. Berrange
2016-09-21  3:49 ` [Qemu-devel] [PATCH 8/9] docker: Terminate instances at SIGTERM and SIGHUP Fam Zheng
2016-09-21  8:42   ` Daniel P. Berrange [this message]
2016-09-21  3:49 ` [Qemu-devel] [PATCH 9/9] docker: exec $CMD Fam Zheng
2016-09-21  8:43   ` Daniel P. Berrange

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=20160921084243.GI15535@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.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).