All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Alistair Francis <alistair.francis@xilinx.com>,
	openembedded-core@lists.openembedded.org,
	liezhi.yang@windriver.com, ross.burton@intel.com
Subject: Re: [PATCH v2 2/2] runqemu: Add a background command option
Date: Sat, 01 Apr 2017 08:19:31 +0100	[thread overview]
Message-ID: <1491031171.13980.377.camel@linuxfoundation.org> (raw)
In-Reply-To: <20170324203858.27464-2-alistair.francis@xilinx.com>

On Fri, 2017-03-24 at 13:38 -0700, Alistair Francis wrote:
> This allows callers to specify commands that should be run in the
> background
> while running QEMU. This can be specified by assigning the commands
> to the
> 'QB_BACKGROUND_COMMAND' varialbe in the machine conf.
> 
> This is useful for starting automated debugging instances, automated
> testing instances (using QMP) or other servers/clients that QEMU can
> connect to.
> 
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> ---
>  scripts/runqemu | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/scripts/runqemu b/scripts/runqemu
> index f76d976..b5cc56a 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -1118,6 +1118,13 @@ class BaseConfig(object):
>                  kernel_opts += " -dtb %s" % self.dtb
>          else:
>              kernel_opts = ""
> +        background_cmd = self.get('QB_BACKGROUND_COMMAND')
> +
> +        if background_cmd:
> +            logger.info('Running in the background %s' %
> background_cmd)
> +            if subprocess.call(background_cmd + ' &', shell=True) !=
> 0:
> +                raise Exception('Failed to run %s' % cmd)
> +

I have to admit I'm rather unsure about this. What cleans up this
process when runqemu finishes?

We tend to run into a lot of issues around cleanup and a subprocess
using "&" doesn't sound too attractive given the general issues we run
into.

Cheers,

Richard


  reply	other threads:[~2017-04-01  7:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24 20:38 [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot Alistair Francis
2017-03-24 20:38 ` [PATCH v2 2/2] runqemu: Add a background command option Alistair Francis
2017-04-01  7:19   ` Richard Purdie [this message]
2017-04-03 17:47     ` Alistair Francis
2017-03-31 17:07 ` [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot Alistair Francis
2017-04-07 16:59   ` Alistair Francis
2017-04-18 21:08     ` Alistair Francis

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=1491031171.13980.377.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=alistair.francis@xilinx.com \
    --cc=liezhi.yang@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ross.burton@intel.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.