qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Michal Privoznik <mprivozn@redhat.com>
Subject: Re: [PATCH v3 1/6] migration: Allow immutable device state to be migrated early (i.e., before RAM)
Date: Wed, 11 Jan 2023 18:44:45 +0100	[thread overview]
Message-ID: <1711a861-c3a5-0851-347f-0106ade37976@redhat.com> (raw)
In-Reply-To: <Y77xsBnqW2per5sE@x1n>

>>>
>>> Not against it if you want to keep exploring, but if so please avoid using
>>> the priority field, also I'd hope the early vmsd will be saved within
>>> qemu_savevm_state_setup() so maybe it can be another alternative to
>>> save_setup().
>>>
>>> Maybe it's still easier we keep going with the save_setup() and the shim
>>> functions above, if it works for you.
>>
>> I'll happy to go the path you suggested if we can make it work. I'd be happy
>> to have something "reasonable" for the virtio-mem device in the
>> analyze-migration.py output. But I could live with just nothing useful for
>> the device itself -- as long as at least the other devices still show up.
> 
> So, let's see whether we can go back to the load_state() approach..
> 
> static const SaveVMHandlers vmstate_virtio_mem_device_early_ops = {
>        .save_setup = virtio_mem_save_setup_early,
>        .save_state = virtio_mem_save_state_early,
>        .load_state = virtio_mem_load_state_early,
> };
> 
> vfio handled it using a single header flag for either save_setup() or
> save_state(), then load_state() identifies it:
> 
>      data = qemu_get_be64(f);
>      ...
>          switch (data) {
>          case VFIO_MIG_FLAG_DEV_CONFIG_STATE:
>          ...
>          case VFIO_MIG_FLAG_DEV_SETUP_STATE:
>          ...
> 
> Maybe play the same trick here?  The flag needs to be hard coded but at
> least not the vmsd.  Based on previous experience, I could have missed
> something else, though. :)

I could also remember "internally" if load_state() was already called 
throughout the migartion I think.

But, IIUC, it will still make analyze-migration.py produce wrong 
results, because of the vmdesc mismatch.

> 
> Or if you like go the other way I'm fine too.

IMHO my approach will be cleaner on the device side but will require 
migration code changes. I'll try getting that as clean as possible for 
now and resend. If there are more ideas on how to get the other approach 
running, I'll be happy to try.

Thanks!

-- 
Thanks,

David / dhildenb



  reply	other threads:[~2023-01-11 17:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 11:02 [PATCH v3 0/6] virtio-mem: Handle preallocation with migration David Hildenbrand
2022-12-22 11:02 ` [PATCH v3 1/6] migration: Allow immutable device state to be migrated early (i.e., before RAM) David Hildenbrand
2022-12-23  9:34   ` David Hildenbrand
2023-01-05  1:27     ` Michael S. Tsirkin
2023-01-05  8:20       ` David Hildenbrand
2023-01-04 17:23   ` Peter Xu
2023-01-05  8:35     ` David Hildenbrand
2023-01-05 17:15       ` Peter Xu
2023-01-09 14:34         ` David Hildenbrand
2023-01-09 19:54           ` Peter Xu
2023-01-10 10:18             ` David Hildenbrand
2023-01-10 11:52               ` David Hildenbrand
2023-01-10 20:03                 ` Peter Xu
2023-01-11 13:48                   ` David Hildenbrand
2023-01-11 16:35                     ` Peter Xu
2023-01-11 16:58                       ` David Hildenbrand
2023-01-11 17:28                         ` Peter Xu
2023-01-11 17:44                           ` David Hildenbrand [this message]
2022-12-22 11:02 ` [PATCH v3 2/6] migration/vmstate: Introduce VMSTATE_WITH_TMP_TEST() and VMSTATE_BITMAP_TEST() David Hildenbrand
2023-01-05 17:33   ` Dr. David Alan Gilbert
2022-12-22 11:02 ` [PATCH v3 3/6] migration: Factor out checks for advised and listening incomming postcopy David Hildenbrand
2023-01-05 17:18   ` Peter Xu
2023-01-09 14:39     ` David Hildenbrand
2023-01-09 14:42       ` David Hildenbrand
2022-12-22 11:02 ` [PATCH v3 4/6] virtio-mem: Fail if a memory backend with "prealloc=on" is specified David Hildenbrand
2022-12-22 11:02 ` [PATCH v3 5/6] virtio-mem: Migrate bitmap, size and sanity checks early David Hildenbrand
2022-12-22 11:02 ` [PATCH v3 6/6] virtio-mem: Proper support for preallocation with migration David Hildenbrand

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=1711a861-c3a5-0851-347f-0106ade37976@redhat.com \
    --to=david@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=mprivozn@redhat.com \
    --cc=mst@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).