From 6417c4560a1226aa926156150d3bc324a10ede41 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Tue, 18 Oct 2011 13:36:43 +0100 Subject: libxl: convert VFB handling to device API Signed-off-by: Ian Campbell Acked-by: Ian Jackson Committed-by: Ian Jackson --- tools/ocaml/libs/xl/genwrap.py | 5 +---- tools/ocaml/libs/xl/xenlight_stubs.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'tools/ocaml') diff --git a/tools/ocaml/libs/xl/genwrap.py b/tools/ocaml/libs/xl/genwrap.py index c73d40fb63..f9e2e81e95 100644 --- a/tools/ocaml/libs/xl/genwrap.py +++ b/tools/ocaml/libs/xl/genwrap.py @@ -22,10 +22,7 @@ DEVICE_FUNCTIONS = [ ("add", ["t", "domid", "unit"]), ] functions = { # ( name , [type1,type2,....] ) - "device_vfb": [ ("add", ["t", "domid", "unit"]), - ("clean_shutdown", ["domid", "unit"]), - ("hard_shutdown", ["domid", "unit"]), - ], + "device_vfb": DEVICE_FUNCTIONS, "device_vkb": DEVICE_FUNCTIONS, "device_disk": DEVICE_FUNCTIONS, "device_nic": DEVICE_FUNCTIONS, diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c index eea91345d4..f7790b7dd0 100644 --- a/tools/ocaml/libs/xl/xenlight_stubs.c +++ b/tools/ocaml/libs/xl/xenlight_stubs.c @@ -360,14 +360,17 @@ value stub_xl_device_vfb_add(value info, value domid) CAMLreturn(Val_unit); } -value stub_xl_device_vfb_clean_shutdown(value domid) +value stub_xl_device_vfb_remove(value info, value domid) { CAMLparam1(domid); + libxl_device_vfb c_info; int ret; INIT_STRUCT(); + device_vfb_val(&gc, &lg, &c_info, info); + INIT_CTX(); - ret = libxl_device_vfb_clean_shutdown(ctx, Int_val(domid)); + ret = libxl_device_vfb_remove(ctx, Int_val(domid), &c_info); if (ret != 0) failwith_xl("vfb_clean_shutdown", &lg); FREE_CTX(); @@ -375,14 +378,17 @@ value stub_xl_device_vfb_clean_shutdown(value domid) CAMLreturn(Val_unit); } -value stub_xl_device_vfb_hard_shutdown(value domid) +value stub_xl_device_vfb_destroy(value info, value domid) { CAMLparam1(domid); + libxl_device_vfb c_info; int ret; INIT_STRUCT(); + device_vfb_val(&gc, &lg, &c_info, info); + INIT_CTX(); - ret = libxl_device_vfb_hard_shutdown(ctx, Int_val(domid)); + ret = libxl_device_vfb_destroy(ctx, Int_val(domid), &c_info); if (ret != 0) failwith_xl("vfb_hard_shutdown", &lg); FREE_CTX(); -- cgit v1.2.3