diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2011-09-29 16:24:12 +0200 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2011-09-29 16:24:12 +0200 |
commit | 7a0d96dc7283ff13167aa1a57bf8afadea3894fa (patch) | |
tree | 01b1238f11b67aed34588fd9c6ec1497dd5428bc | |
parent | a5c63b90832cb365e47b3c941f3a076afee26c96 (diff) |
changed save-state/load-state behaviour to stop the vm you save
-rwxr-xr-x | kvm-wrapper.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kvm-wrapper.sh b/kvm-wrapper.sh index 32ff8e8..6fe2c7e 100755 --- a/kvm-wrapper.sh +++ b/kvm-wrapper.sh @@ -535,6 +535,7 @@ function kvm_run_disk () function kvm_start_screen () { + check_create_dir "$RUN_DIR" $SCREEN_START_ATTACHED "$SCREEN_SESSION_NAME" $SCREEN_EXTRA_OPTS "$SCRIPT_PATH" start-here "$VM_NAME" } @@ -946,14 +947,20 @@ case "$1" in if [[ $# -eq 2 ]]; then ! test_file "$PID_FILE" && fail_exit "Error : $VM_NAME doesn't seem to be running." ! test_socket_rw "$MONITOR_FILE" && fail_exit "Error : could not open monitor socket $MONITOR_FILE." -# monitor_send_cmd "stop" + monitor_send_cmd "stop" monitor_send_cmd "migrate_set_speed 4095m" monitor_send_cmd "migrate \"exec:gzip -c > /var/cache/kvm-wrapper/$2-state.gz\"" - monitor_send_cmd "cont" + monitor_send_cmd "quit" else print_help; fi ;; load-state) if [[ $# -eq 2 ]]; then + check_create_dir "$RUN_DIR" + $SCREEN_START_ATTACHED "$SCREEN_SESSION_NAME" $SCREEN_EXTRA_OPTS "$SCRIPT_PATH" load-state-here "$VM_NAME" + else print_help; fi + ;; + load-state-here) + if [[ $# -eq 2 ]]; then KVM_ADDITIONNAL_PARAMS+=" -incoming \"exec: gzip -c -d /var/cache/kvm-wrapper/$2-state.gz\"" FORCE="yes" kvm_start_vm "$2" |