From f529f735df82517e5c1fcfabc2873b45ccff1692 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Fri, 22 Nov 2024 08:36:34 -0500 Subject: [PATCH] cmdlib.sh: drop runvm_with_cache_snapshot() This is now no longer used. runvm_with_cache_snapshot was used by runvm-osbuild previously but it's not needed any longer and cosa supermin-run --snapshot was used by build-podman-os job in the pipeline, but that isn't being used either so we can drop it. --- src/cmd-supermin-run | 7 +------ src/cmdlib.sh | 13 +++---------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/cmd-supermin-run b/src/cmd-supermin-run index dfcf2e0493..1ecde4da76 100755 --- a/src/cmd-supermin-run +++ b/src/cmd-supermin-run @@ -6,7 +6,7 @@ dn=$(dirname "$0") . "${dn}"/cmdlib.sh print_help() { - echo "Usage: cosa supermin-run [--cache|--snapshot] COMMAND [ARG...]" >&2 + echo "Usage: cosa supermin-run [--cache] COMMAND [ARG...]" >&2 } if [ $# = 0 ]; then @@ -21,11 +21,6 @@ case "$1" in set -- runvm_with_cache -- "$@" need_cache_dir=1 ;; - --snapshot) - shift - set -- runvm_with_cache_snapshot on -- "$@" - need_cache_dir=1 - ;; --*) echo "unrecognized option: $1" print_help diff --git a/src/cmdlib.sh b/src/cmdlib.sh index f8b8408d3c..9e84366f6c 100755 --- a/src/cmdlib.sh +++ b/src/cmdlib.sh @@ -574,10 +574,8 @@ runcompose_tree() { fi } -# Run with cache disk with optional snapshot=on, which means no changes get written back to -# the cache disk. `runvm_with_cache_snapshot on` will set snapshotting to on. -runvm_with_cache_snapshot() { - local snapshot=$1; shift +# Run with cache disk. +runvm_with_cache() { local cache_size=${RUNVM_CACHE_SIZE:-30G} # "cache2" has an explicit label so we can find it in qemu easily if [ ! -f "${workdir}"/cache/cache2.qcow2 ]; then @@ -590,16 +588,11 @@ runvm_with_cache_snapshot() { fi # And remove the old one rm -vf "${workdir}"/cache/cache.qcow2 - cache_args+=("-drive" "if=none,id=cache,discard=unmap,snapshot=${snapshot},file=${workdir}/cache/cache2.qcow2" \ + cache_args+=("-drive" "if=none,id=cache,discard=unmap,file=${workdir}/cache/cache2.qcow2" \ "-device" "virtio-blk,drive=cache") runvm "${cache_args[@]}" "$@" } -runvm_with_cache() { - local snapshot='off' - runvm_with_cache_snapshot $snapshot "$@" -} - # Strips out the digest field from lockfiles since they subtly conflict with # various workflows. strip_out_lockfile_digests() {