qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org,  Kevin Wolf <kwolf@redhat.com>,
	 "Michael S. Tsirkin" <mst@redhat.com>,
	 Fabiano Rosas <farosas@suse.de>,  John Snow <jsnow@redhat.com>,
	 Hanna Reitz <hreitz@redhat.com>,
	 Leonardo Bras <leobras@redhat.com>,
	 Samuel Thibault <samuel.thibault@ens-lyon.org>,
	qemu-block@nongnu.org,  Peter Xu <peterx@redhat.com>,
	 Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH v2 5/9] migration: check required subsections are loaded, once
Date: Tue, 24 Oct 2023 12:41:56 +0200	[thread overview]
Message-ID: <875y2w1evf.fsf@secure.mitica> (raw)
In-Reply-To: <20231024084043.2926316-6-marcandre.lureau@redhat.com> (marcandre lureau's message of "Tue, 24 Oct 2023 12:40:39 +0400")

marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Check that required subsections have been loaded.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

I will let other people to comment on this before merging.

I can see the (pontential problem) that Peter said: We still don't have
enough state.

But I can also see the problem that you are trying to fix: A needed
subsection didn't came.

> @@ -492,7 +521,7 @@ static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd,
>              /* it doesn't have a valid subsection name */
>              return 0;
>          }
> -        sub_vmsd = vmstate_get_subsection(vmsd->subsections, idstr);
> +        sub_vmsd = vmstate_get_subsection(vmsd->subsections, idstr, visited);
>          if (sub_vmsd == NULL) {
>              trace_vmstate_subsection_load_bad(vmsd->name, idstr, "(lookup)");
>              return -ENOENT;

I fully agree that a given subsection shouldn't be loaded more than once.
The part needed for this can get in at any point.



> @@ -509,6 +538,13 @@ static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd,
>          }
>      }
>  
> +    for (i = 0; i < n; i++) {
> +        if (!visited[i] && vmstate_section_needed(vmsd->subsections[i], opaque)) {
> +            trace_vmstate_subsection_load_bad(vmsd->name, vmsd->subsections[i]->name, "(not visited)");
> +            return -ENOENT;
> +        }
> +    }
> +
>      trace_vmstate_subsection_load_good(vmsd->name);
>      return 0;
>  }

This part is the only one where I can see there could be some
discussion.  So I wil wait to see what other people think.

Later, Juan.



  reply	other threads:[~2023-10-24 10:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24  8:40 [PATCH v2 0/9] RFC: migration: check required entries and sections are loaded marcandre.lureau
2023-10-24  8:40 ` [PATCH v2 1/9] block/fdc: 'phase' is not needed on load marcandre.lureau
2023-10-24  8:40 ` [PATCH v2 2/9] virtio: make endian_needed() work during loading marcandre.lureau
2023-10-24  8:40 ` [PATCH v2 3/9] net/slirp: use different IDs for each instance marcandre.lureau
2023-10-24  9:26   ` Juan Quintela
2023-10-24  8:40 ` [PATCH v2 4/9] migration: rename vmstate_save_needed->vmstate_section_needed marcandre.lureau
2023-10-24 10:35   ` Juan Quintela
2023-10-24  8:40 ` [PATCH v2 5/9] migration: check required subsections are loaded, once marcandre.lureau
2023-10-24 10:41   ` Juan Quintela [this message]
2023-10-24 20:10     ` Peter Xu
2023-10-24  8:40 ` [PATCH v2 6/9] migration: check required entries " marcandre.lureau
2023-10-24 10:44   ` Juan Quintela
2023-10-24  8:40 ` [PATCH v2 7/9] migration: set file error on subsection loading marcandre.lureau
2023-10-24  9:27   ` Juan Quintela
2023-10-24  8:40 ` [PATCH v2 8/9] test-vmstate: add some subsection tests marcandre.lureau
2023-10-24 10:45   ` Juan Quintela
2023-10-24  8:40 ` [PATCH v2 9/9] docs/migration: reflect the changes about needed subsections marcandre.lureau
2023-10-24 10:47   ` Juan Quintela
2023-10-24 10:58     ` Marc-André Lureau
2023-10-24 11:08       ` Juan Quintela

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=875y2w1evf.fsf@secure.mitica \
    --to=quintela@redhat.com \
    --cc=farosas@suse.de \
    --cc=hreitz@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=leobras@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=samuel.thibault@ens-lyon.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 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).