All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org,
	 Leonardo Bras Soares Passos <lsoaresp@redhat.com>
Subject: Re: [PATCH 1/2] migration/vmstate-dump: Dump array size too as "num"
Date: Wed, 26 Apr 2023 18:30:05 +0200	[thread overview]
Message-ID: <87bkjafvxu.fsf@secure.mitica> (raw)
In-Reply-To: <20230425180544.1815888-2-peterx@redhat.com> (Peter Xu's message of "Tue, 25 Apr 2023 14:05:43 -0400")

Peter Xu <peterx@redhat.com> wrote:
> For VMS_ARRAY typed vmsd fields, also dump the number of entries in the
> array in -vmstate-dump.
>
> Without such information, vmstate static checker can report false negatives
> of incompatible vmsd on VMS_ARRAY typed fields, when the src/dst do not
> have the same type of array defined.  It's because in the checker we only
> check against size of fields within a VMSD field.
>
> One example: e1000e used to have a field defined as a boolean array with 5
> entries, then removed it and replaced it with UNUSED (in 31e3f318c8b535):
>
> -        VMSTATE_BOOL_ARRAY(core.eitr_intr_pending, E1000EState,
> -                           E1000E_MSIX_VEC_NUM),
> +        VMSTATE_UNUSED(E1000E_MSIX_VEC_NUM),
>
> It's a legal replacement but vmstate static checker is not happy with it,
> because it checks only against the "size" field between the two
> fields (here one is BOOL_ARRAY, the other is UNUSED):
>
> For BOOL_ARRAY:
>
>       {
>         "field": "core.eitr_intr_pending",
>         "version_id": 0,
>         "field_exists": false,
>         "size": 1
>       },
>
> For UNUSED:
>
>       {
>         "field": "unused",
>         "version_id": 0,
>         "field_exists": false,
>         "size": 5
>       },
>
> It's not the script to blame because there's just not enough information
> dumped to show the total size of the entry for an array.  Add it.
>
> Note that this will not break old vmstate checker because the field will
> just be ignored.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>

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

queued.



  reply	other threads:[~2023-04-26 16:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 18:05 [PATCH 0/2] vmstate-static-checker: Fix VMS_ARRAY comparisons Peter Xu
2023-04-25 18:05 ` [PATCH 1/2] migration/vmstate-dump: Dump array size too as "num" Peter Xu
2023-04-26 16:30   ` Juan Quintela [this message]
2023-04-25 18:05 ` [PATCH 2/2] vmstate-static-checker: Recognize "num" field Peter Xu
2023-04-26 16:30   ` Juan Quintela
2023-04-26 16:36 ` [PATCH 0/2] vmstate-static-checker: Fix VMS_ARRAY comparisons Juan Quintela
2023-04-26 18:37   ` Peter Xu
2023-04-26 18:54     ` Juan Quintela
2023-04-26 19:12       ` Peter Xu

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=87bkjafvxu.fsf@secure.mitica \
    --to=quintela@redhat.com \
    --cc=lsoaresp@redhat.com \
    --cc=peterx@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.