qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Barrett <dbarrett@quinthar.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Signal handling and qcow2 image corruption
Date: Wed, 05 Mar 2008 15:48:52 -0800	[thread overview]
Message-ID: <47CF3164.2000103@quinthar.com> (raw)
In-Reply-To: <47CF16C5.6040102@codemonkey.ws>

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
> 
> 
> 
> 

  reply	other threads:[~2008-03-05 23:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 21:18 [Qemu-devel] Signal handling and qcow2 image corruption David Barrett
2008-03-05 21:55 ` Anthony Liguori
2008-03-05 23:48   ` David Barrett [this message]
2008-03-06  6:57   ` Avi Kivity
2008-07-21 18:10   ` [Qemu-devel] qcow2 - safe on kill? safe on power fail? Jamie Lokier
2008-07-21 19:43     ` Anthony Liguori
2008-07-21 21:26       ` Jamie Lokier
2008-07-21 22:14         ` Anthony Liguori
2008-07-21 23:47           ` Jamie Lokier
2008-07-22  6:06           ` Avi Kivity
2008-07-22 14:08             ` Anthony Liguori
2008-07-22 14:46               ` Jamie Lokier
2008-07-22 19:11               ` Avi Kivity
2008-07-22 14:32             ` Jamie Lokier
2008-07-21 22:00       ` Andreas Schwab
2008-07-21 22:15         ` Anthony Liguori
2008-07-21 22:22           ` David Barrett
2008-07-21 22:50             ` Anthony Liguori
2008-07-22  6:07           ` Avi Kivity
2008-07-22 14:11             ` Anthony Liguori
2008-07-22 14:36               ` Avi Kivity
2008-07-22 16:16                 ` Jamie Lokier
2008-07-22 19:13                   ` Avi Kivity
2008-07-22 20:04                     ` Jamie Lokier
2008-07-22 21:25                       ` Avi Kivity
2008-07-22 14:22             ` Jamie Lokier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47CF3164.2000103@quinthar.com \
    --to=dbarrett@quinthar.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).