From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JX3MM-0002W2-W9 for qemu-devel@nongnu.org; Wed, 05 Mar 2008 18:49:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JX3MM-0002Vq-Hp for qemu-devel@nongnu.org; Wed, 05 Mar 2008 18:49:18 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JX3MM-0002Vn-Ca for qemu-devel@nongnu.org; Wed, 05 Mar 2008 18:49:18 -0500 Received: from quinthar.com ([72.52.120.178]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JX3ML-00006o-8R for qemu-devel@nongnu.org; Wed, 05 Mar 2008 18:49:17 -0500 Received: from 76.231.185.49 ([76.231.185.49]) by quinthar.com for ; Wed, 5 Mar 2008 15:49:21 -0800 Message-ID: <47CF3164.2000103@quinthar.com> Date: Wed, 05 Mar 2008 15:48:52 -0800 From: David Barrett MIME-Version: 1.0 Subject: Re: [Qemu-devel] Signal handling and qcow2 image corruption References: <47CF0E0C.9030807@quinthar.com> <47CF16C5.6040102@codemonkey.ws> In-Reply-To: <47CF16C5.6040102@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 ==== dbarrett@LappyReborn:~/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 ==== dbarrett@LappyReborn:~/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 ==== dbarrett@LappyReborn:~/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 > > > >