#46 Resolve issue #45: TOCTOU race on port
Merged by stefw. Opened by cevich.
cevich/standard-test-roles fix_toctou  into  master

Download 46.patch

In the host() function, an available port is located,
bound, then released, well before starting the qemu
process. However, during the interval, another process
could easily grab the port, causing an exception to be raised.

Avoid this situation by wrapping both the port search and
qemu process launch, inside a retry loop. If retries are
exceeded, display the error from the qemu process to aid
in debugging.

Signed-off-by: Chris Evich cevich@redhat.com

This looks good to me. Tested with concurrent inventory usage fighting for ports (even though that's not really something that's supported by the spec).

Pull-Request has been merged by stefw

Metadata