Received: from [140.186.70.92] (port=56692 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7OIs-0004Kf-Nu for qemu-devel@nongnu.org; Wed, 06 Apr 2011 04:41:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7OIp-0004CQ-CJ for qemu-devel@nongnu.org; Wed, 06 Apr 2011 04:41:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7OIp-0004Bi-1b for qemu-devel@nongnu.org; Wed, 06 Apr 2011 04:41:27 -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 p368fPYP027315 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Apr 2011 04:41:25 -0400 From: Juan Quintela In-Reply-To: <19861.41721.462027.268384@gargle.gargle.HOWL> (Jason Wang's message of "Fri, 1 Apr 2011 18:03:37 +0800") References: <1301638940-22372-1-git-send-email-jasowang@redhat.com> <4D957B7D.3060802@redhat.com> <19861.41721.462027.268384@gargle.gargle.HOWL> Date: Wed, 06 Apr 2011 10:41:17 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register Reply-To: quintela@redhat.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: kwolf@redhat.com, Paolo Bonzini , qemu-devel@nongnu.org, Jes.Sorensen@redhat.com 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. > > > (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 If you do this, you are just removing the capability of migrating to older versions. If you need to send a subsection unconditionlly, then just upgrade the version of the device, it is going to give the same result. Later, Juan.