From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPvcJ-0007Cz-Ni for qemu-devel@nongnu.org; Fri, 05 Sep 2014 11:40:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPvcA-0002kN-ND for qemu-devel@nongnu.org; Fri, 05 Sep 2014 11:40:03 -0400 Received: from mail-we0-x22b.google.com ([2a00:1450:400c:c03::22b]:55492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPvcA-0002kD-Gn for qemu-devel@nongnu.org; Fri, 05 Sep 2014 11:39:54 -0400 Received: by mail-we0-f171.google.com with SMTP id u56so12092594wes.2 for ; Fri, 05 Sep 2014 08:39:53 -0700 (PDT) Date: Fri, 5 Sep 2014 16:39:51 +0100 From: Stefan Hajnoczi Message-ID: <20140905153951.GJ27649@stefanha-thinkpad.redhat.com> References: <20140830145313.GN14001@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="07FIeBX8hApXX6Bi" Content-Disposition: inline In-Reply-To: <20140830145313.GN14001@redhat.com> Subject: Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" Cc: kwolf@redhat.com, qemu-devel@nongnu.org --07FIeBX8hApXX6Bi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 30, 2014 at 03:53:13PM +0100, Richard W.M. Jones wrote: > I found out a few days ago that if you: >=20 > (1) Open a qcow2 file that has lazy_refcounts =3D on and a backing file, = and >=20 > (2) Write lots of stuff, and >=20 > (3) Kill qemu with SIGTERM [which I believed, maybe incorrectly, is a > "nice" way to kill qemu] >=20 > .. 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. >=20 > 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? >=20 > I can reproduce this easily, although of course the reproducer will > involve libguestfs. That is very interesting, thanks for posting. Did you try older QEMU versions? I'm curious if this is something that crept in later or is fundamentally broken in lazy_refcounts=3Don. Stefan --07FIeBX8hApXX6Bi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUCdlHAAoJEJykq7OBq3PIxLUH/2vnZkL1IZ6DT+CN3N2TLS6i 5w6oLMF7Bt1LgkExmEhCImAFl/Vz1whVlWZ9FgiXsslYWmc4UER3A5gS7lHv5TVr SeawZuCDwtHuOACnsUhDBI8V8Fvd7xOT8TOTaoDObTkE2I1BAUW33uP8t7Y8p2zQ eOHi/Df1pgUgWLXDrtr6bWIoQx5Y3wdABstC9pSf30Gw2oDG/nenB6+aJ4noYzlS zN2MAoVGC4qqSiZjdRw74Sg6aaeyGLdV6DrtO/yAji9kHli29grL/Ut73zwvwAvu pKrRO7o0D1xNc4eQxwZpggiO3cjSnPF7FpK89UvhaOkCvZrN7BKY6bwF2Dv/o4I= =JJq2 -----END PGP SIGNATURE----- --07FIeBX8hApXX6Bi--