Skip to content

Commit

Permalink
[kvm]: add debug cmd for build_kvm_image.sh (#6472)
Browse files Browse the repository at this point in the history
dump netstat info on error

Signed-off-by: Guohan Lu <[email protected]>
  • Loading branch information
lguohan authored Jan 17, 2021
1 parent ece8297 commit 9b2bc88
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/build_kvm_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on_exit()

on_error()
{
netstat -antp
echo "============= kvm_log =============="
cat $kvm_log
}
Expand Down Expand Up @@ -51,12 +52,12 @@ create_disk
prepare_installer_disk

echo "Prepare memory for KVM build: $vs_build_prepare_mem"
sudo mount proc /proc -t proc || true
mount proc /proc -t proc || true
free -m
if [[ "$vs_build_prepare_mem" == "yes" ]]; then
# Force o.s. to drop cache and compact memory so that KVM can get 2G memory
sudo bash -c 'echo 1 > /proc/sys/vm/drop_caches'
sudo bash -c 'echo 1 > /proc/sys/vm/compact_memory'
bash -c 'echo 1 > /proc/sys/vm/drop_caches'
bash -c 'echo 1 > /proc/sys/vm/compact_memory'
free -m
fi

Expand Down

0 comments on commit 9b2bc88

Please sign in to comment.