Skip to content

Commit

Permalink
runvm: Implement optional cache size for 'runvm' via env var
Browse files Browse the repository at this point in the history
 - The current cache size for aarch64 during podman-related
operations is insufficient. We require a method to expand it
to enable the utilization of the cache feature by runvm. By
implementing this, we can conveniently adjust the cache size
as needed by passing it in the env var 'RUNVM_CACHE_SIZE'.

Signed-off-by: Renata Ravanelli <[email protected]>
  • Loading branch information
ravanelli authored and jlebon committed Mar 12, 2024
1 parent 558bf5f commit 9009664
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,10 @@ runcompose_extensions() {
# the cache disk. `runvm_with_cache_snapshot on` will set snapshotting to on.
runvm_with_cache_snapshot() {
local snapshot=$1; shift
local cache_size=${RUNVM_CACHE_SIZE:-16G}
# "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 16G
qemu-img create -f qcow2 cache2.qcow2.tmp "$cache_size"
(
# shellcheck source=src/libguestfish.sh
source /usr/lib/coreos-assembler/libguestfish.sh
Expand Down

0 comments on commit 9009664

Please sign in to comment.