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

Re: [PATCH 3/6] tools: Introduce a non-truncating xc_xenver_capabilities()


  • 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=5nh+if3ho7GK7CykAU+41RYUAatQCoDUpykcYpBTVRE=; b=oOsbVgLAD/bZcabz3bbtydah7jXHTS6hUZoCPc1e6umNvUFlp/is6NZQRqF+7ZbputJsRCAaCcHkKykacNBfsMZwdiScSeVbqLdkWB3jDSDXvR3RGeMj1CeLdiQYR+b+Knk4bZRdO1DIbsjWcT0HIfABrBrixBFCJiDvMylLswKNzc4HlR7YorubS+iLGon725sEJaWQEIoSs0TJ9Em+8o/HTZgIauWuSReGLbHT/eBdh/kQXpzlbQSRxDZPFC9qg0g56qoAF0ufqZCeyarKlbU1kyFxjbWDLylCYWhJP8I0/+RY2C7T6F9mLaYhJOGfSz08eIH31WVVTcAESyXlig==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kf2i97KXE6CV0/DHomVRGZ6Hxz+bYF5TwZ7SDRK7AeFQQNlzsoyfnqSSd6tfYrXgSpZyZti4SczIIwwMosb5m0irYSy6LQ6IKx+NOp7WGELXSbaWoB9m/r3kfSAShgyhN3CEl5Z3QubdeZh0dF+VKJsbKFZbndaqXqrbcgJxpr4MyqxpsWcgrDfTJZrNEPHEMBeW9QrfU20Z7wn0AIMlb0fRUslXCZDHt1E/eG5vYuBceAibQZhjbVLLNIxJSAsED7dD9GRgvnRA7rsQxkJ9T6A0FN45RZK+uggrXizk99l99mKUUILwjyFLVyeipkLamyPzPcJSH+yzWa/zjUTQog==
  • 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:30 +0000
  • Ironport-data: A9a23:PLitN68B+l4aOnyGK9cuDrUDvX+TJUtcMsCJ2f8bNWPcYEJGY0x3m 2ROWmrUPayDNGL3Lt0iboS//E1VvpCDzoQxHVRtpHg8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKucYHsZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kIw1BjOkGlA5AdmPKkb5AO2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDkkVz 9cBGm8JaiyolrOIw7S/ddhiudkseZyD0IM34hmMzBn/JNN/G9XpZfWP4tVVmjAtmspJAPDSI dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWOilUujtABM/KMEjCObc5VhEeDu mPP+SL9AxcWNdO3wjuZ6HO8wOTImEsXXapDTuPirKE23TV/wEQLMj08VEClisLkqROARvsPK k0b/icH+P1aGEuDC4OVsweDiG6JuFsQVsRdF8U+6RqR0ezE7gCBHG8GQzVdLts8u6ceWjgCx lKP2dTzClRHsrKPTmmG3qyJtj70Mi8QRUcObDEJZREI6N7ipMc0lB2nczp4OKu8j9mwEzegx TmP9XI6n+9K0pBN0Lin91fahT7qvoLOUgM++gTQWCSi8x99Y4mmIYev7DA38Mp9EWpQdXHZ1 FBspiRUxLtm4U2l/MBVfNgwIQ==
  • Ironport-hdrordr: A9a23:jAVjZqG91ipUi8SNpLqE4MeALOsnbusQ8zAXPhZKOHlom6uj5q KTdZUgpHzJYVMqMk3I9ursBEDtex/hHP1OgbX5X43NYOCOggLBR72KhrGC/9SPIULDHl8379 YFT5RD
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZKnsh/SnHJk9rC02Qsh/SBqHxSa6kLY6A
  • Thread-topic: [PATCH 3/6] tools: Introduce a non-truncating xc_xenver_capabilities()


> 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>
> ---
> 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            |  4 +---
> tools/ocaml/libs/xc/xenctrl_stubs.c | 17 +++++++++++++++--
> 4 files changed, 22 insertions(+), 5 deletions(-)

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

> 
> diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
> index 1e88d49371a4..279dc17d67d4 100644
> --- a/tools/include/xenctrl.h
> +++ b/tools/include/xenctrl.h
> @@ -1609,6 +1609,7 @@ int xc_version(xc_interface *xch, int cmd, void *arg);
>  * free().
>  */
> char *xc_xenver_extraversion(xc_interface *xch);
> +char *xc_xenver_capabilities(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 2c14474feec5..512302a393ea 100644
> --- a/tools/libs/ctrl/xc_version.c
> +++ b/tools/libs/ctrl/xc_version.c
> @@ -156,3 +156,8 @@ char *xc_xenver_extraversion(xc_interface *xch)
> {
>     return varbuf_simple_string(xch, XENVER_extraversion2);
> }
> +
> +char *xc_xenver_capabilities(xc_interface *xch)
> +{
> +    return varbuf_simple_string(xch, XENVER_capabilities2);
> +}
> diff --git a/tools/libs/light/libxl.c b/tools/libs/light/libxl.c
> index 3e16e568839c..139e838d1407 100644
> --- a/tools/libs/light/libxl.c
> +++ b/tools/libs/light/libxl.c
> @@ -583,7 +583,6 @@ const libxl_version_info* 
> libxl_get_version_info(libxl_ctx *ctx)
>     union {
>         xen_compile_info_t xen_cc;
>         xen_changeset_info_t xen_chgset;
> -        xen_capabilities_info_t xen_caps;
>         xen_platform_parameters_t p_parms;
>         xen_commandline_t xen_commandline;
>         xen_build_id_t build_id;
> @@ -607,8 +606,7 @@ const libxl_version_info* 
> libxl_get_version_info(libxl_ctx *ctx)
>     info->compile_domain = libxl__strdup(NOGC, u.xen_cc.compile_domain);
>     info->compile_date = libxl__strdup(NOGC, u.xen_cc.compile_date);
> 
> -    xc_version(ctx->xch, XENVER_capabilities, &u.xen_caps);
> -    info->capabilities = libxl__strdup(NOGC, u.xen_caps);
> +    info->capabilities = xc_xenver_capabilities(ctx->xch);
> 
>     xc_version(ctx->xch, XENVER_changeset, &u.xen_chgset);
>     info->changeset = libxl__strdup(NOGC, u.xen_chgset);
> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c 
> b/tools/ocaml/libs/xc/xenctrl_stubs.c
> index f3ce12dd8683..368f4727f0a0 100644
> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> @@ -1009,9 +1009,22 @@ CAMLprim value stub_xc_version_changeset(value xch)
> 
> CAMLprim value stub_xc_version_capabilities(value xch)
> {
> -     xen_capabilities_info_t ci;
> +     CAMLparam1(xch);
> +     CAMLlocal1(result);
> +     char *capabilities;
> +
> +     caml_enter_blocking_section();
> +     retval = xc_xenver_capabilities(_H(xch));
> +     caml_leave_blocking_section();
> 
> -     return xc_version_single_string(xch, XENVER_capabilities, &ci);
> +     if (!capabilities)
> +             failwith_xc(_H(xch));
> +
> +     result = caml_copy_string(capabilities);
> +
> +     free(capabilities);
> +
> +     CAMLreturn(result);
> }
> 
> 
> -- 
> 2.11.0
> 




 


Rackspace

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