Skip to content

Commit

Permalink
cmdlib.sh: drop runvm_with_cache_snapshot()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dustymabe committed Nov 23, 2024
1 parent 5ab44b8 commit f529f73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
7 changes: 1 addition & 6 deletions src/cmd-supermin-run
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
13 changes: 3 additions & 10 deletions src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down

0 comments on commit f529f73

Please sign in to comment.