Received: from [140.186.70.92] (port=43529 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7RcA-00037f-7X for qemu-devel@nongnu.org; Wed, 06 Apr 2011 08:13:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7Rc8-0006uN-Pl for qemu-devel@nongnu.org; Wed, 06 Apr 2011 08:13:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7Rc8-0006u1-Be for qemu-devel@nongnu.org; Wed, 06 Apr 2011 08:13:36 -0400 From: Juan Quintela In-Reply-To: <1302086071-15742-1-git-send-email-jasowang@redhat.com> (Jason Wang's message of "Wed, 6 Apr 2011 18:34:31 +0800") References: <1302086071-15742-1-git-send-email-jasowang@redhat.com> Date: Wed, 06 Apr 2011 14:13:26 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH v4] 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, pbonzini@redhat.com, qemu-devel@nongnu.org, Jes.Sorensen@redhat.com Jason Wang wrote: > We need to keep DIR register unchanged across migration, but currently it > depends on the media_changed flags from block layer. Since we do not > save/restore it and the bdrv_open() called in dest node may set the > media_changed flag when trying to open floppy image, guest driver may think the > floppy have changed after migration. To fix this, a new filed media_changed in > FDrive strcutre was introduced in order to save and restore the it from block > layer through pre_save/post_load callbacks. > > Signed-off-by: Jason Wang > --- > > Changed from V3: > According to Juan's suggestions, back to v2 and just add the checking for > media_changed "changed" in .needed. > Do not fail the migration when src have a drive but dest does not, we can treat > it as user ejected the floppy. > > Changed from V2: > According to Paolo's suggestions, a default_migration_media_changed property was > added to avoid saving subsections as much as possible. Its was set media_changed > in pre_load callback and then we can avoid the saving when it was equal to the > media_changed when migrating the FDrive. Behaviors of elder machine types are > also kept through compat_props. > > Changed from V1: > Check the drive->bs during post_load. > > hw/fdc.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- > 1 files changed, 50 insertions(+), 1 deletions(-) > Reviewed-by: Juan Quintela This solution is way less invasive that v3, and achieves exactly the same compatibility.