[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 07/17] libxc/restore: STATIC_DATA_END inference for v2 compatibility


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxx>
  • Date: Mon, 24 Feb 2020 17:32:10 +0000
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@xxxxxxxxxx; spf=Pass smtp.mailfrom=Ian.Jackson@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 24 Feb 2020 17:32:18 +0000
  • Ironport-sdr: LGxwpyBBGxu0hQhK649PmPZKt0/XKjPLbMTPYr03Wtll98e7+J8Iky42GCNgmRJnTr94o+TxgP ckXVooLJI6fizoDppdzviLyn3H1+yv2yRei9oyI887EB0euOoIZUoWT1CM9oTRdRr44Gc/Td0Q Sny28CES1/42W5NvkGSX9MeTSLVIminoWEblqsphgp/GQsgOrm+J8L7OZ1R11xo+dS/x5qFE/x UwYDEMw5fWclChVSrEHfhAZPa/FbpJVmkJyRvK2AgsQMJtVcmlTJ5vhc4MfBSD4TO3KxitUGtD siQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Andrew Cooper writes ("[PATCH v2 07/17] libxc/restore: STATIC_DATA_END 
inference for v2 compatibility"):
> A v3 stream can compatibly read a v2 stream by inferring the position of the
> STATIC_DATA_END record.
> 
> v2 compatibility is only needed for x86.  No other architectures exist yet,
> but they will have a minimum of v3 when introduced.
> 
> The x86 HVM compatibility point being in handle_page_data() (which is common
> code) is a bit awkward.  However, as the two compatibility points are subtly
> different, and it is (intentionally) not possible to call into arch specific
> code from common code (except via the ops hooks), use some #ifdef-ary and
> opencode the check, rather than make handle_page_data() a per-arch helper.
...
> +#if defined(__i386__) || defined(__x86_64__)
> +    /* v2 compat.  Infer the position of STATIC_DATA_END. */
> +    if ( ctx->restore.format_version < 3 && 
> !ctx->restore.seen_static_data_end )
> +    {
> +        rc = handle_static_data_end(ctx);
> +        if ( rc )

These 17 lines appears twice, in basically identical form.  Could it
be refactored ?

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.