OSDN Git Service

qemu-iotests: Fix core dump suppression in test 039
authorMarkus Armbruster <armbru@redhat.com>
Wed, 14 May 2014 13:12:34 +0000 (15:12 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 19 May 2014 09:36:49 +0000 (11:36 +0200)
commitd530e342320d4db3c9522bfadc60a7bc8142343a
tree9d17fe3b3854bbc46fc9a3b6e413cd67198cc2ea
parent4ad303369c8818fb8bbe9f9c9f79e5de7c68e81e
qemu-iotests: Fix core dump suppression in test 039

The shell script attempts to suppress core dumps like this:

    old_ulimit=$(ulimit -c)
    ulimit -c 0
    $QEMU_IO arg...
    ulimit -c "$old_ulimit"

This breaks the test hard unless the limit was zero to begin with!
ulimit sets both hard and soft limit by default, and (re-)raising the
hard limit requires privileges.  Broken since it was added in commit
dc68afe.

Could be fixed by adding -S to set only the soft limit, but I'm not
sure how portable that is in practice.  Simply do it in a subshell
instead, like this:

    (ulimit -c 0; exec $QEMU_IO arg...)

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/qemu-iotests/039
tests/qemu-iotests/039.out
tests/qemu-iotests/common.filter