qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu
Date: Mon, 1 Sep 2014 14:41:02 +0200	[thread overview]
Message-ID: <20140901144102.0aaae712@bahia.local> (raw)
In-Reply-To: <20140830145313.GN14001@redhat.com>

On Sat, 30 Aug 2014 15:53:13 +0100
"Richard W.M. Jones" <rjones@redhat.com> wrote:
> I found out a few days ago that if you:
> 
> (1) Open a qcow2 file that has lazy_refcounts = on and a backing file, and
> 
> (2) Write lots of stuff, and
> 
> (3) Kill qemu with SIGTERM [which I believed, maybe incorrectly, is a
> "nice" way to kill qemu]
> 
> .. then you can end up with a corrupt qcow2 file.  In particular the
> qcow2 file sometimes forgot that it had a backing file, but I suspect
> this was just a symptom and in fact the qcow2 file header wasn't being
> written to disk correctly.
> 

Hi Rich,

Someone in IBM hit a very similar issue with PowerKVM a few monthes ago.
The symptom was a corrupted filesystem in a qcow2 file. The steps
involved to kill the QEMU process while the guest OS is shutting down.
Unfortunately, no easy reproducer could be found and investigations
halted...

> Is it correct that sending SIGTERM to qemu should kill it cleanly, or
> is that no longer the case, or is lazy_refcounts a special case, or
> have I found a bug?
> 

QEMU catches SIGTERM and calls bdrv_close(), so I would favor it is
a bug or an undocumented limitation (hence a documentation bug :)

> I can reproduce this easily, although of course the reproducer will
> involve libguestfs.
> 
> Rich.
> 

Can you share this reproducer ?

Cheers.

--
Greg

  reply	other threads:[~2014-09-01 12:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-30 14:53 [Qemu-devel] qcow2, lazy_refcounts and killing qemu Richard W.M. Jones
2014-09-01 12:41 ` Greg Kurz [this message]
2014-09-01 13:07   ` Richard W.M. Jones
2014-09-01 14:19   ` Richard W.M. Jones
2014-09-01 14:23     ` Richard W.M. Jones
2014-09-01 14:30     ` Greg Kurz
2014-09-05 15:39 ` Stefan Hajnoczi
2014-09-05 17:41   ` Richard W.M. Jones
2014-09-08  7:16     ` Markus Armbruster
2014-09-08 18:29       ` Max Reitz
2014-09-08  9:57     ` Stefan Hajnoczi

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=20140901144102.0aaae712@bahia.local \
    --to=gkurz@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    /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).