Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -582,24 +582,9 @@ runcompose_extensions() {
}

runvm_with_cache() {
# "cache2" has an explicit label so we can find it in qemu easily
if [ ! -f "${workdir}"/cache/cache2.qcow2 ]; then
qemu-img create -f qcow2 cache2.qcow2.tmp 10G
(
# shellcheck source=src/libguestfish.sh
source /usr/lib/coreos-assembler/libguestfish.sh
virt-format --filesystem=xfs --label=cosa-cache -a cache2.qcow2.tmp)
mv -T cache2.qcow2.tmp "${workdir}"/cache/cache2.qcow2
fi
# And remove the old one
# Clean up old cache qcow2; we now always rely on virtiofs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since CI failed and we'll need to do another run.. maybe we can add a comment here to say to delete the runvm_with_cache function after 2023 to let future us know for sure when it's safe to get rid of it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we can move the rm -vf to runvm() and nuke it now. There's only two callers of that function, defined just above it.

rm -vf "${workdir}"/cache/cache.qcow2
local cachedriveargs="discard=unmap"
if is_transient; then
cachedriveargs="cache=unsafe,discard=ignore"
fi
cache_args+=("-drive" "if=none,id=cache,$cachedriveargs,file=${workdir}/cache/cache2.qcow2" \
"-device" "virtio-blk,drive=cache")
runvm "${cache_args[@]}" "$@"
runvm "$@"
}

# Strips out the digest field from lockfiles since they subtly conflict with
Expand Down