Ah thanks, that makes a lot of sense. Unfortunately, -snapshot doesn't
appear to work with -loadvm: any VM snapshots created outside of
snapshot mode are suppressed, and any VM snapshots created inside
snapshot mode disappear on close (even if you try to commit):
===== I have a snapshot VM named 'boot' that -snapshot can't find ====
[EMAIL PROTECTED]:~/rs/qa$ qemu -smb qemu -kernel-kqemu -localtime -m
512 -monitor stdio -loadvm boot -snapshot winxp.qcow2
QEMU 0.9.0 monitor - type 'help' for more information
(qemu) Could not find snapshot 'boot' on device 'hda'
(qemu) info snapshots
Snapshot devices: hda
Snapshot list (from hda):
ID TAG VM SIZE DATE VM CLOCK
============ When I try to save one it appears to work.... ===========
(qemu) savevm boot
(qemu) commit all
(qemu) info snapshots
Snapshot devices: hda
Snapshot list (from hda):
ID TAG VM SIZE DATE VM CLOCK
1 boot 27M 2008-03-05 15:37:35 00:00:23.114
(qemu) quit
==== ...but when I start up again with -snapshot, it can't find it ====
[EMAIL PROTECTED]:~/rs/qa$ qemu -smb qemu -kernel-kqemu -localtime -m
512 -monitor stdio -loadvm boot -snapshot winxp.qcow2
QEMU 0.9.0 monitor - type 'help' for more information
(qemu) Could not find snapshot 'boot' on device 'hda'
(qemu) info snapshots
Snapshot devices: hda
Snapshot list (from hda):
ID TAG VM SIZE DATE VM CLOCK
(qemu)
=== But when -snapshot is disabled, it finds my snapshot VM again ====
[EMAIL PROTECTED]:~/rs/qa$ qemu -smb qemu -kernel-kqemu -localtime -m
512 -monitor stdio -loadvm boot winxp.qcow2
QEMU 0.9.0 monitor - type 'help' for more information
(qemu) info snapshots
Snapshot devices: hda
Snapshot list (from hda):
ID TAG VM SIZE DATE VM CLOCK
1 boot 53M 2008-03-03 17:30:58 01:40:10.163
(qemu)
I think the solution is to skip -snapshot, use -loadvm, and just use a
named pipe to send a "quit" command to the monitor in order to shut it
down rather than SIGTERM.
Thanks for your help!
-david
Anthony Liguori wrote:
David Barrett wrote:
I'm tracking down a image corruption issue and I'm curious if you can
answer the following:
1) Is there any difference between sending a "TERM" signal to the QEMU
process and typing "quit" at the monitor?
Yes. Since QEMU is single threaded, when you issue a quit, you know you
aren't in the middle of writing qcow2 meta data to disk.
2) Will sending TERM corrupt the 'gcow2' image (in ways other than
normal guest OS dirty shutdown)?
Possibly, yes.
3) Assuming I always start QEMU using "-loadvm", is there any risk in
using 'kill' to send SIGTERM to the QMEU process when done?
Yes. If you want to SIGTERM QEMU, the safest thing to do is use -snapshot.
Regards,
Anthony Liguori