iotests: Explicitly bequeath FDs in Python
commitbf43b29df4cdc716f4a2af98b37e206a11541d99
authorMax Reitz <mreitz@redhat.com>
Mon, 22 Oct 2018 13:53:04 +0000 (22 14:53 +0100)
committerEduardo Habkost <ehabkost@redhat.com>
Wed, 31 Oct 2018 00:11:52 +0000 (30 21:11 -0300)
tree9223b810092433e21071b9c0200e8231cfb12489
parent68474776f354bc728db58cf349fe3ed0f63a306e
iotests: Explicitly bequeath FDs in Python

Python 3.4 introduced the inheritable attribute for FDs.  At the same
time, it changed the default so that all FDs are not inheritable by
default, that only inheritable FDs are inherited to subprocesses, and
only if close_fds is explicitly set to False.

Adhere to this by setting close_fds to False when working with
subprocesses that may want to inherit FDs, and by trying to
set_inheritable() on FDs that we do want to bequeath to them.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20181022135307.14398-7-mreitz@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
scripts/qemu.py
tests/qemu-iotests/045
tests/qemu-iotests/147