[Ilugc] Re: Question about shutting down Guest KVMs during HOST OS shutdown

  • From: vijaykumar@xxxxxxxxxxxx (Vijay Kumar)
  • Date: Wed Nov 25 15:50:29 2009

Arun Khan <knura@...> writes:
 

relevant excerpt:

send_cmd() {
       QEMU_MONITOR_COMMAND=$1
       echo "${QEMU_MONITOR_COMMAND}" | socat - UNIX-CONNECT:${FILE_MONITOR}
}

This script uses Qemu's monitor interface. The monitor interface has a
system_powerdown command that can be used trigger an event to cleanly shutdown
the system. Unfortunately this does not seem to work (Please check if this works
for you). One work-around is to configure the guest's init to halt the system
when it receives an ctrl-alt-delete as shown below

File:/etc/inittab
- ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
+ ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -h now

And then use the following monitor command, to generate a ctrl-alt-delete
sequence, when the system has to be halted.

sendkey ctrl-alt-delete

Regards,
Vijay

Other related posts: