From a084a6bbcebf1122b4f38a2a6770d57694885adf Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Sat, 2 Jun 2012 08:39:45 +0100 Subject: [PATCH] ocaml: fix build after 25446:648508ee27a2, 25449:68d46c5ea0a3 et al. These renamed a type and the associated functions and the ocaml bindings were not updated to suit. This also highlighted that libxl_domain_sched_params should not be DIR_IN since it is also use as an output struct. Signed-off-by: Ian Campbell Committed-by: Ian Campbell --- tools/libxl/libxl_types.idl | 2 +- tools/ocaml/libs/xl/genwrap.py | 5 +++-- tools/ocaml/libs/xl/xenlight_stubs.c | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index a77bbf722d..a528da2c17 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -232,7 +232,7 @@ libxl_domain_sched_params = Struct("domain_sched_params",[ ("slice", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT'}), ("latency", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_LATENCY_DEFAULT'}), ("extratime", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT'}), - ], dir=DIR_IN) + ]) libxl_domain_build_info = Struct("domain_build_info",[ ("max_vcpus", integer), diff --git a/tools/ocaml/libs/xl/genwrap.py b/tools/ocaml/libs/xl/genwrap.py index 384ec5b4ea..b379b57108 100644 --- a/tools/ocaml/libs/xl/genwrap.py +++ b/tools/ocaml/libs/xl/genwrap.py @@ -32,8 +32,9 @@ functions = { # ( name , [type1,type2,....] ) ], "cputopology": [ ("get", ["unit", "t array"]), ], - "sched_credit": [ ("domain_get", ["domid", "t"]), - ("domain_set", ["domid", "t", "unit"]), + "domain_sched_params": + [ ("get", ["domid", "t"]), + ("set", ["domid", "t", "unit"]), ], } def stub_fn_name(ty, name): diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c index 2ba07fc579..c712b2bd01 100644 --- a/tools/ocaml/libs/xl/xenlight_stubs.c +++ b/tools/ocaml/libs/xl/xenlight_stubs.c @@ -496,37 +496,37 @@ value stub_xl_cputopology_get(value unit) CAMLreturn(topology); } -value stub_xl_sched_credit_domain_get(value domid) +value stub_xl_domain_sched_params_get(value domid) { CAMLparam1(domid); CAMLlocal1(scinfo); - libxl_sched_credit_domain c_scinfo; + libxl_domain_sched_params c_scinfo; int ret; INIT_STRUCT(); INIT_CTX(); - ret = libxl_sched_credit_domain_get(ctx, Int_val(domid), &c_scinfo); + ret = libxl_domain_sched_params_get(ctx, Int_val(domid), &c_scinfo); if (ret != 0) - failwith_xl("sched_credit_domain_get", &lg); + failwith_xl("domain_sched_params_get", &lg); FREE_CTX(); - scinfo = Val_sched_credit_domain(&gc, &lg, &c_scinfo); + scinfo = Val_domain_sched_params(&gc, &lg, &c_scinfo); CAMLreturn(scinfo); } -value stub_xl_sched_credit_domain_set(value domid, value scinfo) +value stub_xl_domain_sched_params_set(value domid, value scinfo) { CAMLparam2(domid, scinfo); - libxl_sched_credit_domain c_scinfo; + libxl_domain_sched_params c_scinfo; int ret; INIT_STRUCT(); - sched_credit_domain_val(&gc, &lg, &c_scinfo, scinfo); + domain_sched_params_val(&gc, &lg, &c_scinfo, scinfo); INIT_CTX(); - ret = libxl_sched_credit_domain_set(ctx, Int_val(domid), &c_scinfo); + ret = libxl_domain_sched_params_set(ctx, Int_val(domid), &c_scinfo); if (ret != 0) - failwith_xl("sched_credit_domain_set", &lg); + failwith_xl("domain_sched_params_set", &lg); FREE_CTX(); CAMLreturn(Val_unit); -- 2.39.5