Skip to contentSkip to conversation

SIGTERM signal to qemu-kvm process

Qemu-devel Jatin Davey 2 participants 3 messages Apr 8, 2015 – Apr 9, 2015

lore
Share & tools
lore
#0 lore raw

Hi

I am using QEMU 0.12.1 as the hypervisor in my RHEL installation of 6.5.

I wanted to know if there are any side-effects with respect to VM image corruption when i use SIGTERM signal to kill a qemu-kvm process which effectively stops my VM running on the host.

Appreciate if you can provide me some valuable information in this regard.

Thanks
Jatin

#1 lore raw

Am 08.04.2015 um 07:07 hat Jatin Davey geschrieben:

Quoted 7 lines

I am using QEMU 0.12.1 as the hypervisor in my RHEL installation of 6.5.

I wanted to know if there are any side-effects with respect to VM image corruption when i use SIGTERM signal to kill a qemu-kvm process which effectively stops my VM running on the host.

Appreciate if you can provide me some valuable information in this regard.

Sending SIGTERM is equivalent to sending a 'quit' monitor command. This is a clean shutdown as far as qemu is concerned, but of course it isn't for your guest OS.

If your guest behaves correctly, you may lose data that wasn't flushed to disk yet, but you should not get any corruption. The image file structure itself (i.e. what 'qemu-img check' checks) should be fully consistent.

Sending SIGKILL is a bit worse (just like a host crash/power failure), because then even the image file may be inconsistent. But again, if the guest behaves correct (and assuming there are no qemu bugs and you're not using cache=unsafe), even in this case the result should never be corruption, but only loss of data that wasn't flushed to disk yet.

Kevin

#2 lore raw
Quoted 17 lines · Kevin Wolf

Am 08.04.2015 um 07:07 hat Jatin Davey geschrieben:

Quoted 7 lines

I am using QEMU 0.12.1 as the hypervisor in my RHEL installation of 6.5.

I wanted to know if there are any side-effects with respect to VM image corruption when i use SIGTERM signal to kill a qemu-kvm process which effectively stops my VM running on the host.

Appreciate if you can provide me some valuable information in this regard.

Sending SIGTERM is equivalent to sending a 'quit' monitor command. This is a clean shutdown as far as qemu is concerned, but of course it isn't for your guest OS.

If your guest behaves correctly, you may lose data that wasn't flushed to disk yet, but you should not get any corruption. The image file structure itself (i.e. what 'qemu-img check' checks) should be fully consistent.

Quoted 7 lines

Sending SIGKILL is a bit worse (just like a host crash/power failure), because then even the image file may be inconsistent. But again, if the guest behaves correct (and assuming there are no qemu bugs and you're not using cache=unsafe), even in this case the result should never be corruption, but only loss of data that wasn't flushed to disk yet.

Kevin

Thanks Kevin.

Appreciate your prompt response in this regard.

Thanks
Jatin