Re: [Qemu-devel] [PATCH 2/4] Add cleanup function

2012-01-20 Thread Ryan Harper
* Eric Blake [2012-01-17 16:03]: > On 01/16/2012 10:16 AM, Ryan Harper wrote: > >>> if test -z "$1" -o -z "$2"; then > >>> echo "Usage: $0 QEMU TEST1 [TEST2 ...]" > >>> +cleanup > >>> exit 1 > >> > >> Is it worth using 'trap cleanup 0' to install the cleanup handler up > >> front, i

Re: [Qemu-devel] [PATCH 2/4] Add cleanup function

2012-01-17 Thread Eric Blake
On 01/16/2012 10:16 AM, Ryan Harper wrote: >>> if test -z "$1" -o -z "$2"; then >>> echo "Usage: $0 QEMU TEST1 [TEST2 ...]" >>> +cleanup >>> exit 1 >> >> Is it worth using 'trap cleanup 0' to install the cleanup handler up >> front, instead of modifying all exit call sites? > > I th

Re: [Qemu-devel] [PATCH 2/4] Add cleanup function

2012-01-16 Thread Ryan Harper
* Eric Blake [2012-01-13 17:18]: > On 01/13/2012 03:05 PM, Ryan Harper wrote: > > Create a cleanup function and call it from all exits so we don't leave > > temp files and directories around since we change the name on each > > invocation. > > > > Also, no need to delete the files in the tmpdir

Re: [Qemu-devel] [PATCH 2/4] Add cleanup function

2012-01-13 Thread Eric Blake
On 01/13/2012 03:05 PM, Ryan Harper wrote: > Create a cleanup function and call it from all exits so we don't leave > temp files and directories around since we change the name on each invocation. > > Also, no need to delete the files in the tmpdir, so just remove the tmpdir > if it exists. > >

[Qemu-devel] [PATCH 2/4] Add cleanup function

2012-01-13 Thread Ryan Harper
Create a cleanup function and call it from all exits so we don't leave temp files and directories around since we change the name on each invocation. Also, no need to delete the files in the tmpdir, so just remove the tmpdir if it exists. Signed-off-by: Ryan Harper --- qemu-test | 11 +++