[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v20210701 10/40] tools: add xc_is_known_page_type to libxenctrl
- To: Olaf Hering <olaf@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Fri, 2 Jul 2021 20:20:08 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8ZyIw04UjhrPa5KiX5OOX2k6ZBfrmL8RM/sb7+4MSIE=; b=TMDQgzPIxdCoTC9sjbjDm24DnCGj4OrbmxrJJjLhYDzX4Ms0rtPLcXZsREPCKlVCypioIhxPp54Q+Qf4+yWd+VxQasXFKC0ctMRcDabw30Sp/p62TZpol6zzI1QQBuOBtFDIBpMlqPWz+xwGwl7m3dJjVruPEgIzqphAtYdPGn4iRA03J3CGQRkyBk4JtfnRT/0cfcMkLDgXZtoYzBVSqwxJEfBSswit5BVotZP9Z5Xx8+HnQRH4d4V/XxJ/y0LCE/90o6bEKulLhGjxeMnEGMzewlZB+A+jM9keYEGYSF/Yx4q3seU6mnea6k72unhabuoo9BW9QahzjcdzgVf7Xw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FWmXMFlUsYPYaa0J63xGwXHvwW+zF3VEDFAwkLAgVGUov2CRhLrSNcVW/MvN3cRygJoOCxI/p1wUSpjSoeU9yUG+eYg3+zusGcDFyhrxiqSmHeYrfcOiqOg6hmeAGmXy0h+5c3Qc+B5+/i0SNSSKPLkv7Pw3JYxi09Z5uSYv7ympHd5Jg3TZfINUFY/oGUhb9cMiKt02zqVnsCoLgJLQtu/83urnMbuaKoBF7RDDQKe9bfqyXDWDUMVZjJyKS5mOjVrDE3fCJ2u52Yqr2zkvtovYuLi2VfcmtVzglv4foC4vjoy/Oi/tToO84DwrZ+NtdyrCmF5KXFLljXtU30zG+w==
- Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
- Delivery-date: Fri, 02 Jul 2021 19:20:30 +0000
- Ironport-hdrordr: A9a23:ERxzZKNDbhuMxMBcTyz155DYdb4zR+YMi2TDiHoedfUFSKOlfp 6V8MjztSWVtN4QMEtQ/uxoS5PwP080kqQFnrX5XI3SIDUO3VHIEGgM1/qY/9SNIVyGygcZ79 YcT0EcMqyDMbEZt7eD3ODQKb9Jq7PrgcPY55ar854ud3ANV0gJ1XYLNu/xKDwSeOApP+tcKH PR3Ls8m9L2Ek5nHvhTS0N1ENTrlpnurtbLcBQGDxko5E2nii6p0qfzF1y90g0FWz1C7L8++S yd+jaJp5mLgrWe8FvxxmXT55NZlJ/IzcZCPtWFjowwJi/3ggilSYx9U/mpvSwzosuo9FE2+e O87SsIDoBW0Tf8b2u1qRzi103LyzA18ULvzleenD/KvdH5bChSMbsCuatpNj/ir2YwttB116 xGm0iDsYBMMB/GlCPho/DVShBRkFauq3ZKq59Rs5Vma/pbVFZtl/1ZwKsMe61wWh4SqbpXUN WGNfusocq/KjihHinkVgAF+q3YYpwxdi32CHTq9PbliwS+p0oJuXfw8vZv1UvoxKhNPKWs2N 60e5iAtIs+A/P+PpgNSNvof6OMeyTwqEX3QROvyBLcZfo6B04=
- Ironport-sdr: 22pzsmOhQAFc27y794eckw6i84WlBRb0t1PSNfqbPJk3s3VlGLLKvBIgFmSFAQDr6tN4ODiuoG qo/HLqw4GlEkzK8RjwHLEjXP06CpV5DO8wnv7xyUCplaYBZHRSPawKqHzNgRnBrtL2z32pKunn a+2IdQZtyhmwcg1M3yFhfEVW9mRmoMCIsaZQJW+XGN7Wds1oUL1/S+MUhYdBJu/YGc73oHvNip 9wXgZtJO3UgRRTMss8dYhJTA9JW1xQRsk2Lm6sox6HZ11ZYhh609dTsAVg7TboVQ9y+gNcs+TZ mY0=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 01/07/2021 10:56, Olaf Hering wrote:
> Users of xc_get_pfn_type_batch may want to sanity check the data
> returned by Xen. Add a simple helper for this purpose.
>
> Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
Subject needs correcting after v2.
However, given that this is in the save/restore common header, does it
really need a prefix? Simply is_known_page_type() seems good enough.
>
> v02:
> - rename xc_is_known_page_type to sr_is_known_page_type
> - move from ctrl/xc_private.h to saverestore/common.h (jgross)
> ---
> tools/libs/saverestore/common.h | 33 +++++++++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/tools/libs/saverestore/common.h b/tools/libs/saverestore/common.h
> index ca2eb47a4f..07c506360c 100644
> --- a/tools/libs/saverestore/common.h
> +++ b/tools/libs/saverestore/common.h
> @@ -467,6 +467,39 @@ int populate_pfns(struct xc_sr_context *ctx, unsigned
> int count,
> /* Handle a STATIC_DATA_END record. */
> int handle_static_data_end(struct xc_sr_context *ctx);
>
> +/* Sanitiy check for types returned by Xen */
> +static inline bool sr_is_known_page_type(xen_pfn_t type)
uint32_t
> +{
> + bool ret;
The logic will be rather shorter and cleaner to read by dropping ret and
using return directly out of the switch.
> +
> + switch (type)
Spaces.
I can fix up everything on commit if you're happy with the suggestions.
~Andrew
|