From: Eric Blake <eblake@redhat.com>
To: Jeff Cody <jcody@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, jsnow@redhat.com, stefanha@redhat.com,
kwolf@redhat.com
Subject: Re: [Qemu-devel] [PATCH v5 05/10] qemu-iotests: change qemu pid and fd tracking / cleanup
Date: Wed, 18 Oct 2017 09:22:31 -0500 [thread overview]
Message-ID: <c93322b0-3d5d-2467-3d75-75e40ad83a9b@redhat.com> (raw)
In-Reply-To: <85b170e6abd3f92bee7449d0970f6ba24e589c72.1508257445.git.jcody@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1649 bytes --]
On 10/17/2017 11:31 AM, Jeff Cody wrote:
> So that later patches can cleanup running qemu processes called from
> different subshells, track resources to cleanup in pid and fd list
> files.
>
> In subsquent patches, ./check will kill all QEMU processes launched with
> the common.qemu framework, and the tests will not need to cleanup
> manually (unless they want to do so as part of the test, e.g. wait for
> a process to end such as migration).
>
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
> tests/qemu-iotests/common.qemu | 82 ++++++++++++++++++++++++++++++++----------
> tests/qemu-iotests/common.rc | 3 +-
> 2 files changed, 64 insertions(+), 21 deletions(-)
Modulo the typo in the commit message in response to your other tweaks,
> + # get line count, and therefore number of processes to kill
> + numproc=$(wc -l "${QEMU_PID_LIST}" | sed 's/\s.*//')
Instead of having to use sed, just do:
numproc=$(wc -l < "${QEMU_PID_LIST}")
wc is required to behave differently when parsing stdin than when
parsing a named file, so you might as well take advantage of it.
> +
> + for i in $(seq 1 $numproc)
Are we sure seq is always available? Shave a subshell, and avoid the
dependency, by using bash's:
for i in {1..$numproc}
> +++ b/tests/qemu-iotests/common.rc
> @@ -40,7 +40,6 @@ poke_file()
> printf "$3" | dd "of=$1" bs=1 "seek=$2" conv=notrunc &>/dev/null
> }
>
> -
> if ! . ./common.config
Spurious whitespace change?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
next prev parent reply other threads:[~2017-10-18 14:22 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 16:31 [Qemu-devel] [PATCH v5 00/10] qemu-iotests improvements Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 01/10] qemu-iotests: refuse to run if TEST_DIR contains spaces Jeff Cody
2017-10-18 1:03 ` Eric Blake
2017-10-18 3:05 ` Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 02/10] qemu-iotests: set TEST_DIR to a unique dir for each test Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers Jeff Cody
2017-10-18 1:15 ` Eric Blake
2017-10-18 14:46 ` Paolo Bonzini
2017-10-18 15:03 ` Jeff Cody
2017-10-18 15:16 ` Paolo Bonzini
2017-10-18 15:34 ` Jeff Cody
2017-10-18 15:39 ` Paolo Bonzini
2017-10-18 15:50 ` Jeff Cody
2017-10-18 15:51 ` Paolo Bonzini
2017-10-18 16:19 ` Jeff Cody
2017-10-18 16:39 ` Paolo Bonzini
2017-10-18 17:27 ` Jeff Cody
2017-10-19 10:23 ` Paolo Bonzini
2017-10-19 14:52 ` Jeff Cody
2017-10-19 21:03 ` Paolo Bonzini
2017-10-18 15:06 ` Eric Blake
2017-10-18 15:43 ` Daniel P. Berrange
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 04/10] qemu-iotests: remove file cleanup from bash tests Jeff Cody
2017-10-18 13:46 ` Eric Blake
2017-10-18 13:56 ` Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 05/10] qemu-iotests: change qemu pid and fd tracking / cleanup Jeff Cody
2017-10-18 13:59 ` Jeff Cody
2017-10-18 14:11 ` Eric Blake
2017-10-18 14:22 ` Eric Blake [this message]
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 06/10] qemu-iotests: make ./check automatically reap QEMU processes Jeff Cody
2017-10-18 14:24 ` Eric Blake
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 07/10] qemu-iotests: run python tests in own subdirectories Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 08/10] qemu-iotests: modify python tests to run from subdir Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 09/10] qemu-iotests: add option to save temp files on error Jeff Cody
2017-10-18 14:33 ` Eric Blake
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 10/10] qemu-iotests: add support for running multi-threaded iotests Jeff Cody
2017-10-18 3:45 ` Jeff Cody
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=c93322b0-3d5d-2467-3d75-75e40ad83a9b@redhat.com \
--to=eblake@redhat.com \
--cc=jcody@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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 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).