ci/crosvm: Simplify the CID setup.
Now that deqp-runner tells us which thread we are, we don't need to go probing for a spare directory to use. Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16485>
This commit is contained in:
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# If run outside of a deqp-runner invoction (e.g. piglit trace replay), then act
|
||||||
|
# the same as the first thread in its threadpool.
|
||||||
|
THREAD=${DEQP_RUNNER_THREAD:-0}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Helper to generate CIDs for virtio-vsock based communication with processes
|
# Helper to generate CIDs for virtio-vsock based communication with processes
|
||||||
# running inside crosvm guests.
|
# running inside crosvm guests.
|
||||||
@@ -26,19 +30,10 @@ set_vsock_context() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
local dir_prefix="/tmp-vsock."
|
VSOCK_TEMP_DIR="/tmp-vsock.${THREAD}"
|
||||||
local cid_prefix=0
|
mkdir $VSOCK_TEMP_DIR || return 1
|
||||||
unset VSOCK_TEMP_DIR
|
|
||||||
|
|
||||||
while [ ${cid_prefix} -lt 128 ]; do
|
VSOCK_CID=$(((CI_JOB_ID & 0x1ffffff) | ((${THREAD} & 0x7f) << 25)))
|
||||||
VSOCK_TEMP_DIR=${dir_prefix}${cid_prefix}
|
|
||||||
mkdir "${VSOCK_TEMP_DIR}" >/dev/null 2>&1 && break || unset VSOCK_TEMP_DIR
|
|
||||||
cid_prefix=$((cid_prefix + 1))
|
|
||||||
done
|
|
||||||
|
|
||||||
[ -n "${VSOCK_TEMP_DIR}" ] || return 1
|
|
||||||
|
|
||||||
VSOCK_CID=$(((CI_JOB_ID & 0x1ffffff) | ((cid_prefix & 0x7f) << 25)))
|
|
||||||
VSOCK_STDOUT=5001
|
VSOCK_STDOUT=5001
|
||||||
VSOCK_STDERR=5002
|
VSOCK_STDERR=5002
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user