From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52956 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5bCl-0007Ur-5R for qemu-devel@nongnu.org; Fri, 01 Apr 2011 06:03:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5bCk-0006jP-AM for qemu-devel@nongnu.org; Fri, 01 Apr 2011 06:03:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5bCj-0006jI-Ta for qemu-devel@nongnu.org; Fri, 01 Apr 2011 06:03:46 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p31A3iet018094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 1 Apr 2011 06:03:44 -0400 From: Jason Wang MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19861.41721.462027.268384@gargle.gargle.HOWL> Date: Fri, 1 Apr 2011 18:03:37 +0800 In-Reply-To: <4D957B7D.3060802@redhat.com> References: <1301638940-22372-1-git-send-email-jasowang@redhat.com> <4D957B7D.3060802@redhat.com> 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: Paolo Bonzini Cc: kwolf@redhat.com, Jes.Sorensen@redhat.com, Jason Wang , qemu-devel@nongnu.org, quintela@redhat.com 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. > (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). A better solution maybe: 1 Set default_migration_media_changed be 0 for 0.15 and 1 for elder 2 Unconditiaonlly send subsection when it was 0, and do not send subsection when it was 1 3 Set media_changed to default_migration_media_changed in pre_load() 4 Let all pre/post to be in subsection After those, we can make sure the migration between 0.15 could get correct media_changed, also make sure the seamless migration between 0.15 and older machine types. Any suggestions? > > + } else { > > + drive->bs->media_changed = drive->media_changed; > > + return 0; > > + } > > The code is also missing the case of a pc-0.14 machine. The problem > here is that the pc-0.15 machine hasn't been created yet, you get the > honor. :( > Would create such one :) > Paolo