From ce53fa0bbf6de14a834b5f44a8592ec12d1506a3 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Fri, 11 Jun 2021 17:08:12 +0000 Subject: [PATCH] stages/qemu: honour coroutines env variable The `OSBUILD_QEMU_IMG_COROUTINES` was introduced to allow specifying the number of coroutines used in `qemu-img convert` by the runner, or osbuild directly. This can be useful in various scenarios, but is specifically used by the rhel 8.2+ runner to limit the number of coroutines used for Aarch64 to one, since a bug in `qemu-img` leads to random hangs on that platform. --- stages/org.osbuild.qemu | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stages/org.osbuild.qemu b/stages/org.osbuild.qemu index 55b0b214..d15b3b9c 100755 --- a/stages/org.osbuild.qemu +++ b/stages/org.osbuild.qemu @@ -163,6 +163,11 @@ def main(inputs, output, options): if callable(extra_args): extra_args = extra_args(fmt) + coroutines = os.environ.get("OSBUILD_QEMU_IMG_COROUTINES") + if coroutines: + print(f"qemu-img coroutines: {coroutines}") + extra_args += ["-m", coroutines] + cmd = [ "qemu-img", "convert", "-O", fmt["type"],