From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53842 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5cRQ-0005Yh-2W for qemu-devel@nongnu.org; Fri, 01 Apr 2011 07:23:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5cRO-0008Io-Tt for qemu-devel@nongnu.org; Fri, 01 Apr 2011 07:22:59 -0400 Received: from mail-px0-f174.google.com ([209.85.212.174]:61731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5cRO-0008IZ-OK for qemu-devel@nongnu.org; Fri, 01 Apr 2011 07:22:58 -0400 Received: by pxi15 with SMTP id 15so844396pxi.33 for ; Fri, 01 Apr 2011 04:22:57 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4D95B58B.6060606@redhat.com> Date: Fri, 01 Apr 2011 13:22:51 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1301638940-22372-1-git-send-email-jasowang@redhat.com> <4D957B7D.3060802@redhat.com> <19861.41721.462027.268384@gargle.gargle.HOWL> In-Reply-To: <19861.41721.462027.268384@gargle.gargle.HOWL> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: kwolf@redhat.com, "Michael S. Tsirkin" , Jes.Sorensen@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org, Amit Shah On 04/01/2011 12:03 PM, Jason Wang wrote: > Paolo Bonzini writes: > > On 04/01/2011 08:22 AM, Jason Wang wrote: > > > + > > > + if (drive->bs == NULL) { > > > + return 1; > > > > Is it okay to return 1 here? Have you tested the case when both the > > source and the target drives have no floppy? > > > > Thanks for the reminding, and it could be fixed by put all pre/post callbacks > into the subsections. Not sure that works, post callbacks are not called for subsections that are not needed. > > (The "media_changed == 2" in my sample code was basically a way to save > > the "media present" state of the drive on the source). > > Right, but it would make subsection saving be the common case (consider most of > the vm may just have one floppy but we have two drives). Hmm, right, there's 2 bits involved---media present and media changed. > 1 Set default_migration_media_changed be 0 for 0.15 and 1 for elder > 2 Unconditionally send subsection when it was 0, and do not send subsection when > it was 1 Which means, never send it for pc-0.14 and always for pc-0.15. At this point I'm starting to think that this new-to-old migration business is a lost cause, and it's easier to bump the version number and just default the field to 1 if the version is old. :( The problem here is that you're solving a different problem than what subsections were supposed to help with. Subsections help with "the value that old versions used is usually but not always correct". Here you have "the value that old versions used is usually *in*correct, but nobody noticed so far". Michael/Amit, as you were the ones proposing stronger new-to-old support, can you read the thread and see if you have any ideas? Paolo