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

Re: [PATCH 4/6] tools: Introduce a non-truncating xc_xenver_changeset()


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Christian Lindig <christian.lindig@xxxxxxxxxx>
  • Date: Wed, 18 Jan 2023 13:34:13 +0000
  • Accept-language: en-GB, en-US
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Zm2TTARn/zWn9ycOQusMteLh4ZURZYmOTXljc+OKHuU=; b=VXeyYuzguuwocidpKJfFgYcq1sBsRJgfyv6wFAsWhCkV3LU1sSFwtnkswPr7S5xrQrwnvWTKBK/oZDccn7fBRO9u+1VNbzFN+YZijj+co5qlwdqVL4vmIDiMBt7zOA2lvCb9K5LQt3/xl52Td/dENiaw1nXPT5UxZUiHZnNsqAlGiIeoXl1WQ4gP5HfVT782t9aUBZF0bhO+3Ix6FJ2XBHdzeVElZf5T56IKXf0PWeqQUYqftyYHyrcn9h7S+KkwkkzB9LK7cPNsoNHTMpeOWrdBsgpF4oN+IutVL3T4eJ6tSIWb1XvLugQlXfumG4GfWJENCWm6oqjy65fUG3puxg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KdDfKstdfMfT5DynhipwxHoPB3kok9//FtgqIejnj9M8vJhDGvJqkW7uFmed0gqLZd71Y1wuNqyyetlbytTU2sd34r++E+p85Y2Rjeu4k9SMI6SK/xkeABH1GqgL8ual4cBBUyNkzILkoswk1wEuqIqmJd/guOV4+Q6eae/jdd5xsACkCBk6ggjYrGps65ElcaCdPj+rNr9jlI+pOfefXWLQ/wOy3gCuMF+uyHUOnumklFl2yZUn9Nc6ustbXqi3aJf19/RucIKsRrBeNS4+mdukuCaIyc5AmbOne8J0cLUVLDbap0d6ZMzVmN1H5BFKyY859S8xqlIN9bbb5gd2/w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, David Scott <dave@xxxxxxxxxx>, Edwin Torok <edvin.torok@xxxxxxxxxx>, Rob Hoes <Rob.Hoes@xxxxxxxxxx>
  • Delivery-date: Wed, 18 Jan 2023 13:34:28 +0000
  • Ironport-data: A9a23:0zObh64y6wi4olNAkLtRtAxRtAXGchMFZxGqfqrLsTDasY5as4F+v mROX22EM67cNGv9fotwO4W290xTscXSnYMwSwdlrHw3Hi5G8cbLO4+Ufxz6V8+wwm8vb2o8t plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraBYnoqLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5mr9VU+45wehBtC5gZlPakS7AeC/5UoJMl3yZ+ZfiOQrrZ8RoZWd 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5my NgccT8AVw66jqHt6e6qUMJTmMJ7BZy+VG8fkikIITDxK98DGMqGaYOaoNhS0XE3m9xEGuvYa 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6OkUooj+aF3Nn9I7RmQe1enlyZv X7H9mK/BhAcON2Q4TGE7mitlqnEmiaTtIc6RefmrKQ13AX7Kmo7OQAse1eeptCFq3W7Zcx+K A8L8Q8Wov1nnKCsZpynN/Gim1aUsxhZV9dOHukS7ACW1rGS8wufHnIDTDNKdJohrsBebSMu/ k+EmZXuHzMHmL+aU3WG7Z+PsCi/fyMSKAcqaSYaQCMf7tLkoYV1iQjAJuuPC4awh9zxXDv2k zaDqXFkg61J1JFVkaKm4VrAnjSg4IDTSRI47RnWWWTj6R5lYImiZMqj7l2zAet8Ebt1h2Kp5 BAs8/VyJshXZX1RvERhmNkwIYw=
  • Ironport-hdrordr: A9a23:0QTvmKE/Xc4hdcQWpLqE18eALOsnbusQ8zAXPo5KOGVom62j5r iTdZEgvyMc5wxhPU3I9erwWpVoBEmslqKdgrNxAV7BZniDhILAFugLhrcKgQeBJ8SUzJ876U 4PSdkZNDQyNzRHZATBjTVQ3+xO/DBPys6Vuds=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZKnskQpdn03JGTUK9g3aWThI8PK6kKyKA
  • Thread-topic: [PATCH 4/6] tools: Introduce a non-truncating xc_xenver_changeset()


> On 17 Jan 2023, at 13:53, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> 
> Update libxl and the ocaml stubs to match.  No API/ABI change in either.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Acked-by: Christian Lindig <christian.lindig@xxxxxxxxxx>


> ---
> CC: Wei Liu <wl@xxxxxxx>
> CC: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> CC: Juergen Gross <jgross@xxxxxxxx>
> CC: Christian Lindig <christian.lindig@xxxxxxxxxx>
> CC: David Scott <dave@xxxxxxxxxx>
> CC: Edwin Torok <edvin.torok@xxxxxxxxxx>
> CC: Rob Hoes <Rob.Hoes@xxxxxxxxxx>
> ---
> tools/include/xenctrl.h             |  1 +
> tools/libs/ctrl/xc_version.c        |  5 +++++
> tools/libs/light/libxl.c            |  5 +----
> tools/ocaml/libs/xc/xenctrl_stubs.c | 19 ++++++++-----------
> 4 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
> index 279dc17d67d4..48dbf3eab75f 100644
> --- a/tools/include/xenctrl.h
> +++ b/tools/include/xenctrl.h
> @@ -1610,6 +1610,7 @@ int xc_version(xc_interface *xch, int cmd, void *arg);
>  */
> char *xc_xenver_extraversion(xc_interface *xch);
> char *xc_xenver_capabilities(xc_interface *xch);
> +char *xc_xenver_changeset(xc_interface *xch);
> 
> int xc_flask_op(xc_interface *xch, xen_flask_op_t *op);
> 
> diff --git a/tools/libs/ctrl/xc_version.c b/tools/libs/ctrl/xc_version.c
> index 512302a393ea..9f2cae03dba8 100644
> --- a/tools/libs/ctrl/xc_version.c
> +++ b/tools/libs/ctrl/xc_version.c
> @@ -161,3 +161,8 @@ char *xc_xenver_capabilities(xc_interface *xch)
> {
>     return varbuf_simple_string(xch, XENVER_capabilities2);
> }
> +
> +char *xc_xenver_changeset(xc_interface *xch)
> +{
> +    return varbuf_simple_string(xch, XENVER_changeset2);
> +}
> diff --git a/tools/libs/light/libxl.c b/tools/libs/light/libxl.c
> index 139e838d1407..80e763aba944 100644
> --- a/tools/libs/light/libxl.c
> +++ b/tools/libs/light/libxl.c
> @@ -582,7 +582,6 @@ const libxl_version_info* 
> libxl_get_version_info(libxl_ctx *ctx)
>     GC_INIT(ctx);
>     union {
>         xen_compile_info_t xen_cc;
> -        xen_changeset_info_t xen_chgset;
>         xen_platform_parameters_t p_parms;
>         xen_commandline_t xen_commandline;
>         xen_build_id_t build_id;
> @@ -607,9 +606,7 @@ const libxl_version_info* 
> libxl_get_version_info(libxl_ctx *ctx)
>     info->compile_date = libxl__strdup(NOGC, u.xen_cc.compile_date);
> 
>     info->capabilities = xc_xenver_capabilities(ctx->xch);
> -
> -    xc_version(ctx->xch, XENVER_changeset, &u.xen_chgset);
> -    info->changeset = libxl__strdup(NOGC, u.xen_chgset);
> +    info->changeset = xc_xenver_changeset(ctx->xch);
> 
>     xc_version(ctx->xch, XENVER_platform_parameters, &u.p_parms);
>     info->virt_start = u.p_parms.virt_start;
> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c 
> b/tools/ocaml/libs/xc/xenctrl_stubs.c
> index 368f4727f0a0..291e92db7300 100644
> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> @@ -983,27 +983,24 @@ CAMLprim value stub_xc_version_compile_info(value xch)
> }
> 
> 
> -static value xc_version_single_string(value xch, int code, void *info)
> +CAMLprim value stub_xc_version_changeset(value xch)
> {
>       CAMLparam1(xch);
> -     int retval;
> +     CAMLlocal1(result);
> +     char *changeset;
> 
>       caml_enter_blocking_section();
> -     retval = xc_version(_H(xch), code, info);
> +     retval = xc_xenver_changeset(_H(xch));
>       caml_leave_blocking_section();
> 
> -     if (retval)
> +     if (!changeset)
>               failwith_xc(_H(xch));
> 
> -     CAMLreturn(caml_copy_string((char *)info));
> -}
> +     result = caml_copy_string(changeset);
> 
> +     free(changeset);
> 
> -CAMLprim value stub_xc_version_changeset(value xch)
> -{
> -     xen_changeset_info_t ci;
> -
> -     return xc_version_single_string(xch, XENVER_changeset, &ci);
> +     CAMLreturn(result);
> }
> 
> 
> -- 
> 2.11.0
> 




 


Rackspace

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