summary refs log tree commit diff stats
path: root/tests/vm/basevm.py
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2024-02-27 14:43:09 +0000
committerAlex Bennée <alex.bennee@linaro.org>2024-02-28 09:09:16 +0000
commit151b7dba391fab64cc008a1fdba6ddcf6f8c39c8 (patch)
treef3df7b7eabbe1a032a8f4b338f64b9929096f2f1 /tests/vm/basevm.py
parentcdb5bfc9f3454e969c51669a2283347b9755d517 (diff)
downloadfocaccia-qemu-151b7dba391fab64cc008a1fdba6ddcf6f8c39c8.tar.gz
focaccia-qemu-151b7dba391fab64cc008a1fdba6ddcf6f8c39c8.zip
tests/vm: avoid re-building the VM images all the time
The main problem is that "check-venv" is a .PHONY target will always
evaluate and trigger a full re-build of the VM images. While its
tempting to drop it from the dependencies that does introduce a
breakage on freshly configured builds.

Fortunately we do have the otherwise redundant --force flag for the
script which up until now was always on. If we make the usage of
--force conditional on dependencies other than check-venv triggering
the update we can avoid the costly rebuild and still run cleanly on a
fresh checkout.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2118
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240227144335.1196131-4-alex.bennee@linaro.org>
Diffstat (limited to 'tests/vm/basevm.py')
-rw-r--r--tests/vm/basevm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index c0d62c0803..f8fd751eb1 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -646,9 +646,9 @@ def main(vmcls, config=None):
         vm = vmcls(args, config=config)
         if args.build_image:
             if os.path.exists(args.image) and not args.force:
-                sys.stderr.writelines(["Image file exists: %s\n" % args.image,
+                sys.stderr.writelines(["Image file exists, skipping build: %s\n" % args.image,
                                       "Use --force option to overwrite\n"])
-                return 1
+                return 0
             return vm.build_image(args.image)
         if args.build_qemu:
             vm.add_source_dir(args.build_qemu)