Received: from eggs.gnu.org ([2001:4830:134:3::10]:48931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTTVn-0004XR-H7 for qemu-devel@nongnu.org; Tue, 08 Oct 2013 05:23:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTTVh-0006AJ-Ie for qemu-devel@nongnu.org; Tue, 08 Oct 2013 05:23:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTTVh-0006AB-AY for qemu-devel@nongnu.org; Tue, 08 Oct 2013 05:23:21 -0400 Date: Tue, 8 Oct 2013 11:23:30 +0200 From: Kevin Wolf Message-ID: <20131008092330.GB25109@dhcp-200-207.str.redhat.com> References: <5253C514.6090103@ozlabs.ru> <5253CAB5.7040708@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5253CAB5.7040708@redhat.com> Subject: Re: [Qemu-devel] savevm/loadvm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Alexey Kardashevskiy , "qemu-devel@nongnu.org" Am 08.10.2013 um 11:04 hat Paolo Bonzini geschrieben: > Il 08/10/2013 10:40, Alexey Kardashevskiy ha scritto: > > However qcow2_save_vmstate() sets bs->growable to 1 for a short time > > (commit 178e08a58f40dd5aef2ce774fe0850f5d0e56918 from 2009) and this > > triggers a branch in bdrv_co_do_writev() which changes bs->total_sectors. > > So when QEMU writes snapshots to the file, the disk_size field of a > > snapshot has bigger value (for example 0x4.007b.8180). > > I think you need to modify qcow2_save_vmstate to save and restore > bs->total_sectors. Can you test that and if so post the patch? It's a regression introduced by commit df2a6f29, right? What you suggest probably works as a quick hack to fix the bug. The VM state functions in qcow2 are getting uglier and uglier, though. Maybe they should avoid going through block.c and adding hacks to disable or revert side effects. Kevin