From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTnzL-0001ad-Lr for qemu-devel@nongnu.org; Wed, 09 Oct 2013 03:15:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTnzE-0007Wa-BP for qemu-devel@nongnu.org; Wed, 09 Oct 2013 03:15:19 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:48043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTnzE-0007W8-4m for qemu-devel@nongnu.org; Wed, 09 Oct 2013 03:15:12 -0400 Received: by mail-pd0-f175.google.com with SMTP id q10so488091pdj.20 for ; Wed, 09 Oct 2013 00:15:08 -0700 (PDT) Message-ID: <52550275.7000007@ozlabs.ru> Date: Wed, 09 Oct 2013 18:15:01 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <5253C514.6090103@ozlabs.ru> <5253CAB5.7040708@redhat.com> <20131008092330.GB25109@dhcp-200-207.str.redhat.com> <5253D174.1060200@redhat.com> In-Reply-To: <5253D174.1060200@redhat.com> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] savevm/loadvm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Kevin Wolf Cc: "qemu-devel@nongnu.org" On 10/08/2013 08:33 PM, Paolo Bonzini wrote: > Il 08/10/2013 11:23, Kevin Wolf ha scritto: >>>> 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? > > Yes, that's what introduced the "if". > >> 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. > > Yes, that would work too. Sorry for my ignorance (I never ever touched this part of qemu) but how can you possibly avoid block.c while doing savevm? The qcow2 driver must not use posix read()/write(), right? So no matter how, all writes end up in bdrv_co_do_writev() which changes blocks number. Or use raw_aio_readv()/raw_aio_writev() API directly? Please give some more hints. Thanks. -- Alexey