[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v5 05/10] qemu-iotests: change qemu pid and fd t
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [PATCH v5 05/10] qemu-iotests: change qemu pid and fd tracking / cleanup |
Date: |
Wed, 18 Oct 2017 09:22:31 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
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 <address@hidden>
> ---
> 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
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH v5 00/10] qemu-iotests improvements, Jeff Cody, 2017/10/17
- [Qemu-block] [PATCH v5 01/10] qemu-iotests: refuse to run if TEST_DIR contains spaces, Jeff Cody, 2017/10/17
- [Qemu-block] [PATCH v5 05/10] qemu-iotests: change qemu pid and fd tracking / cleanup, Jeff Cody, 2017/10/17
- [Qemu-block] [PATCH v5 02/10] qemu-iotests: set TEST_DIR to a unique dir for each test, Jeff Cody, 2017/10/17
- [Qemu-block] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Jeff Cody, 2017/10/17
- Re: [Qemu-block] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Eric Blake, 2017/10/17
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Paolo Bonzini, 2017/10/18
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Jeff Cody, 2017/10/18
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Paolo Bonzini, 2017/10/18
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Jeff Cody, 2017/10/18
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Paolo Bonzini, 2017/10/18
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Jeff Cody, 2017/10/18
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Paolo Bonzini, 2017/10/18