qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zhao Liu <zhao1.liu@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH v2] hpet: do not overwrite properties on post_load
Date: Mon, 17 Feb 2025 14:55:07 +0800	[thread overview]
Message-ID: <Z7LdS0JkMBqUugRZ@intel.com> (raw)
In-Reply-To: <20250216092853.4169458-1-pbonzini@redhat.com>

> @@ -347,14 +330,13 @@ static const VMStateDescription vmstate_hpet = {
>      .version_id = 2,
>      .minimum_version_id = 1,
>      .pre_save = hpet_pre_save,
> -    .pre_load = hpet_pre_load,
>      .post_load = hpet_post_load,
>      .fields = (const VMStateField[]) {
>          VMSTATE_UINT64(config, HPETState),
>          VMSTATE_UINT64(isr, HPETState),
>          VMSTATE_UINT64(hpet_counter, HPETState),
> -        VMSTATE_UINT8_V(num_timers, HPETState, 2),
> -        VMSTATE_VALIDATE("num_timers in range", hpet_validate_num_timers),
> +        VMSTATE_UINT8_V(num_timers_save, HPETState, 2),

This change is safe since it doesn't change the vmstate layout so that
there's no need for bumping up the version.

But I still have the question as the comment in v1 [*]. User doesn't
have any way to modify the number of timers, why not just replace this
vmstate field with "VMSTATE_UNUSED_V(2, 1)"?

Or do you think we should keep the status quo for the future use, even
if these properties have not been modified yet?

[*]: https://lore.kernel.org/qemu-devel/Z5Oq4LppNuN7N6NL@intel.com/

> +        VMSTATE_VALIDATE("num_timers must match", hpet_validate_num_timers),
>          VMSTATE_STRUCT_VARRAY_UINT8(timer, HPETState, num_timers, 0,
>                                      vmstate_hpet_timer, HPETTimer),
>          VMSTATE_END_OF_LIST()
> -- 
> 2.48.1
> 
> 


  reply	other threads:[~2025-02-17  6:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-16  9:28 [PATCH v2] hpet: do not overwrite properties on post_load Paolo Bonzini
2025-02-17  6:55 ` Zhao Liu [this message]
2025-02-17  8:02   ` Paolo Bonzini
2025-02-17  8:44     ` Zhao Liu

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=Z7LdS0JkMBqUugRZ@intel.com \
    --to=zhao1.liu@intel.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 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).