From 5be12f8459600a21e2b382eac6d1f6eea384c728 Mon Sep 17 00:00:00 2001 From: Rafal Wojtczuk Date: Tue, 7 Sep 2010 16:00:14 +0200 Subject: [PATCH] qmemman: switch off memory balancing when doing xm save Apparently, it interferes: INFO (XendCheckpoint:417) ERROR Internal error: Could not get vcpu context INFO (XendCheckpoint:417) ERROR Internal error: Failed to map/save the p2m frame list --- dom0/qmemman/qmemman.py | 2 +- dom0/restore/qubes_prepare_saved_domain.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dom0/qmemman/qmemman.py b/dom0/qmemman/qmemman.py index 8538cfa5..d0cb14ff 100755 --- a/dom0/qmemman/qmemman.py +++ b/dom0/qmemman/qmemman.py @@ -140,7 +140,7 @@ class SystemState: return total_memory_transfer > MIN_TOTAL_MEMORY_TRANSFER def do_balance(self): - if os.path.isfile('/etc/do-not-membalance'): + if os.path.isfile('/var/run/qubes/do-not-membalance'): return self.refresh_memactual() xenfree = self.get_free_xen_memory() diff --git a/dom0/restore/qubes_prepare_saved_domain.sh b/dom0/restore/qubes_prepare_saved_domain.sh index 7c9ca5c4..e1200e5c 100755 --- a/dom0/restore/qubes_prepare_saved_domain.sh +++ b/dom0/restore/qubes_prepare_saved_domain.sh @@ -48,10 +48,16 @@ xenstore-read /local/domain/$ID/qubes_gateway | \ xm block-detach $1 /dev/xvdb MEM=$(xenstore-read /local/domain/$ID/device/qubes_used_mem) echo MEM=$MEM +QMEMMAN_STOP=/var/run/qubes/do-not-membalance +touch $QMEMMAN_STOP xm mem-set $1 $(($MEM/1000)) sleep 1 touch $2 -if ! xm save $1 $2 ; then exit 1 ; fi +if ! xm save $1 $2 ; then + rm -f $QMEMMAN_STOP + exit 1 +fi +rm -f $QMEMMAN_STOP cd $VMDIR tar -Scvf saved_cows.tar root-cow.img swap-cow.img