Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-09-08 Thread Max Reitz
On 08.09.2014 09:16, Markus Armbruster wrote: "Richard W.M. Jones" writes: On Fri, Sep 05, 2014 at 04:39:51PM +0100, Stefan Hajnoczi wrote: Did you try older QEMU versions? I'm curious if this is something that crept in later or is fundamentally broken in lazy_refcounts=on. At your promptin

Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-09-08 Thread Stefan Hajnoczi
On Fri, Sep 05, 2014 at 06:41:37PM +0100, Richard W.M. Jones wrote: > On Fri, Sep 05, 2014 at 04:39:51PM +0100, Stefan Hajnoczi wrote: > > Did you try older QEMU versions? I'm curious if this is something that > > crept in later or is fundamentally broken in lazy_refcounts=on. > > At your prompti

Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-09-08 Thread Markus Armbruster
"Richard W.M. Jones" writes: > On Fri, Sep 05, 2014 at 04:39:51PM +0100, Stefan Hajnoczi wrote: >> Did you try older QEMU versions? I'm curious if this is something that >> crept in later or is fundamentally broken in lazy_refcounts=on. > > At your prompting, I've done a bit more investigation.

Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-09-05 Thread Richard W.M. Jones
On Fri, Sep 05, 2014 at 04:39:51PM +0100, Stefan Hajnoczi wrote: > Did you try older QEMU versions? I'm curious if this is something that > crept in later or is fundamentally broken in lazy_refcounts=on. At your prompting, I've done a bit more investigation. I was basing my observations on qemu

Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-09-05 Thread Stefan Hajnoczi
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: > > (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

Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-09-01 Thread Greg Kurz
On Mon, 1 Sep 2014 15:19:28 +0100 "Richard W.M. Jones" wrote: > A test case, attached. > > Note that you have to look at the output of the final qemu-img info > command. In the case where it goes wrong, the 'backing file:' and > 'backing file format:' lines disappear completely. In the case wh

Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-09-01 Thread Richard W.M. Jones
> # Write stuff to the overlay. > guestfish < add-drive overlay.qcow2 format:qcow2 cachemode:unsafe To head off any suggestions, removing cachemode:unsafe doesn't fix it. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualizat

Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-09-01 Thread Richard W.M. Jones
A test case, attached. Note that you have to look at the output of the final qemu-img info command. In the case where it goes wrong, the 'backing file:' and 'backing file format:' lines disappear completely. In the case where the bug is not reproduced, these lines are still present. It's 100% r

Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-09-01 Thread Richard W.M. Jones
On Mon, Sep 01, 2014 at 02:41:02PM +0200, Greg Kurz wrote: > On Sat, 30 Aug 2014 15:53:13 +0100 > "Richard W.M. Jones" wrote: > > I can reproduce this easily, although of course the reproducer will > > involve libguestfs. > > > > Rich. > > > > Can you share this reproducer ? The immediate repr

Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-09-01 Thread Greg Kurz
On Sat, 30 Aug 2014 15:53:13 +0100 "Richard W.M. Jones" 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 > "n

[Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-08-30 Thread Richard W.M. Jones
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 pa