All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org,
	Jes.Sorensen@redhat.com
Subject: [Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register
Date: Wed, 06 Apr 2011 11:18:47 +0200	[thread overview]
Message-ID: <m3oc4jloug.fsf@neno.mitica> (raw)
In-Reply-To: <1301638940-22372-1-git-send-email-jasowang@redhat.com> (Jason Wang's message of "Fri, 1 Apr 2011 14:22:20 +0800")

Jason Wang <jasowang@redhat.com> 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 <jasowang@redhat.com>
> ---
>
> 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     |   83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
>  hw/pc_piix.c |   48 +++++++++++++++++++++++++++++++++
>  2 files changed, 128 insertions(+), 3 deletions(-)
>

> +static int fdrive_pre_load(void *opaque)

> +static void fdrive_pre_save(void *opaque)

> +static int fdrive_post_load(void *opaque, int version_id)

This three functions can be moved to vmstate_fdrive_media_changed, once
there, it simplifies the "check of drive->bs != NULL.

I really think that we can remove all the
default_migration_media_changed code.

I think that:
- if drive is present: we sent media_changed.
- if drive is not present, we don't sent it.

And that is it, no problem with older versions at all.  If drive is
there, we sent the current media_changed value.  It is just easier to
see what is the default "media_changed" value.  And we only sent it if
it is different.  If we are migrating to 0.14, and media_changed
"changed", migration just fails,  as expected.

Trying to make device working at this level is not going to work.  We
need to fix at the device init devel, and that infrastructure is not
there yet.

Later, Juan.

      parent reply	other threads:[~2011-04-06  9:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01  6:22 [Qemu-devel] [PATCH V3] floppy: save and restore DIR register Jason Wang
2011-04-01  6:54 ` [Qemu-devel] " Jes Sorensen
2011-04-01  7:15 ` Paolo Bonzini
2011-04-01 10:03   ` Jason Wang
2011-04-01 11:22     ` Paolo Bonzini
2011-04-06  8:41     ` Juan Quintela
2011-04-06  9:18 ` Juan Quintela [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3oc4jloug.fsf@neno.mitica \
    --to=quintela@redhat.com \
    --cc=Jes.Sorensen@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.