On 27/03/2018 13:34, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilb...@redhat.com>
> 
> Turn the newly added subsection off for old machine types
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com>
> ---
>  include/hw/compat.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/hw/compat.h b/include/hw/compat.h
> index bc9e3a6627..13242b831a 100644
> --- a/include/hw/compat.h
> +++ b/include/hw/compat.h
> @@ -14,6 +14,10 @@
>          .driver   = "vhost-user-blk-pci",\
>          .property = "vectors",\
>          .value    = "2",\
> +    },{\
> +        .driver   = "e1000",\
> +        .property = "migrate_tso_props",\
> +        .value    = "off",\
>      },
>  
>  #define HW_COMPAT_2_10 \
> 

Unfortunately it's not that easy, because on old machine types
tx.tso_props was stored in tx.props.  So if the subsection is absent you
have to migrate either tx.tso_props or tx.props, depending on s->tx.cptse.

Likewise if you migrate from older versions: if s->tx.props.tse &&
s->tx.cptse, you have to copy s->tx.props to s->tx.tso_props and clear
s->tx.props.  My understanding is that s->tx.tso_props.tse will be 1 if
and only if the source sent s->tx.tso_props.

This seems most easily done with a new field (e.g. vmstate_fixed_props)
that is written in pre_save and set in post_load.

Paolo

Reply via email to