[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [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 >
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |