| Index: lib/cros_vm_lib.sh
|
| diff --git a/lib/cros_vm_lib.sh b/lib/cros_vm_lib.sh
|
| index 7a99cbebe25774791d68a0892780977a8a402f22..543de1aa60579acd87f198908a3afdc341ff43a1 100644
|
| --- a/lib/cros_vm_lib.sh
|
| +++ b/lib/cros_vm_lib.sh
|
| @@ -40,6 +40,7 @@ function start_kvm() {
|
| echo "Starting a KVM instance" >&2
|
| local nographics=""
|
| local usesnapshot=""
|
| + local save_vm_state=""
|
| if [ ${FLAGS_no_graphics} -eq ${FLAGS_TRUE} ]; then
|
| nographics="-nographic -serial none"
|
| fi
|
| @@ -51,6 +52,13 @@ function start_kvm() {
|
| snapshot="-snapshot"
|
| fi
|
|
|
| + if [ ${FLAGS_save_vm_state} -eq ${FLAGS_TRUE} ]; then
|
| + # Redirect the QEMU monitor to the guest usb serial port so tests
|
| + # can trigger a "savevm" command.
|
| + save_vm_state="-monitor telnet::4555,server,nowait
|
| + -usbdevice serial::telnet:127.0.0.1:4555"
|
| + fi
|
| +
|
| sudo kvm -m 1024 \
|
| -vga std \
|
| -pidfile "${KVM_PID_FILE}" \
|
| @@ -58,6 +66,7 @@ function start_kvm() {
|
| -net nic,model=e1000 \
|
| ${nographics} \
|
| ${snapshot} \
|
| + ${save_vm_state} \
|
| -net user,hostfwd=tcp::${FLAGS_ssh_port}-:22 \
|
| -hda "${1}"
|
|
|
|
|