aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ocaml/libs
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-10-18 13:36:43 +0100
committerIan Campbell <ian.campbell@citrix.com>2011-10-18 13:36:43 +0100
commit00580c3a1aa502133cc72d830bdfdaf89ae22eb0 (patch)
tree0ec2219f1c42752c2c826e44bb1e6efdccf8dce3 /tools/ocaml/libs
parent18e09f52f227bdca81c42a158da9948c3948e6a8 (diff)
downloadxen-00580c3a1aa502133cc72d830bdfdaf89ae22eb0.tar.gz
xen-00580c3a1aa502133cc72d830bdfdaf89ae22eb0.tar.bz2
xen-00580c3a1aa502133cc72d830bdfdaf89ae22eb0.zip
libxl: convert VKB handling to device API
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/ocaml/libs')
-rw-r--r--tools/ocaml/libs/xl/genwrap.py5
-rw-r--r--tools/ocaml/libs/xl/xenlight_stubs.c14
2 files changed, 11 insertions, 8 deletions
diff --git a/tools/ocaml/libs/xl/genwrap.py b/tools/ocaml/libs/xl/genwrap.py
index f7edad0930..c73d40fb63 100644
--- a/tools/ocaml/libs/xl/genwrap.py
+++ b/tools/ocaml/libs/xl/genwrap.py
@@ -26,10 +26,7 @@ functions = { # ( name , [type1,type2,....] )
("clean_shutdown", ["domid", "unit"]),
("hard_shutdown", ["domid", "unit"]),
],
- "device_vkb": [ ("add", ["t", "domid", "unit"]),
- ("clean_shutdown", ["domid", "unit"]),
- ("hard_shutdown", ["domid", "unit"]),
- ],
+ "device_vkb": DEVICE_FUNCTIONS,
"device_disk": DEVICE_FUNCTIONS,
"device_nic": DEVICE_FUNCTIONS,
"device_pci": [ ("add", ["t", "domid", "unit"]),
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 3cf889b661..eea91345d4 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -306,14 +306,17 @@ value stub_xl_device_vkb_add(value info, value domid)
CAMLreturn(Val_unit);
}
-value stub_xl_device_vkb_clean_shutdown(value domid)
+value stub_xl_device_vkb_remove(value info, value domid)
{
CAMLparam1(domid);
+ libxl_device_vkb c_info;
int ret;
INIT_STRUCT();
+ device_vkb_val(&gc, &lg, &c_info, info);
+
INIT_CTX();
- ret = libxl_device_vkb_clean_shutdown(ctx, Int_val(domid));
+ ret = libxl_device_vkb_remove(ctx, Int_val(domid), &c_info);
if (ret != 0)
failwith_xl("vkb_clean_shutdown", &lg);
FREE_CTX();
@@ -321,14 +324,17 @@ value stub_xl_device_vkb_clean_shutdown(value domid)
CAMLreturn(Val_unit);
}
-value stub_xl_device_vkb_hard_shutdown(value domid)
+value stub_xl_device_vkb_destroy(value info, value domid)
{
CAMLparam1(domid);
+ libxl_device_vkb c_info;
int ret;
INIT_STRUCT();
+ device_vkb_val(&gc, &lg, &c_info, info);
+
INIT_CTX();
- ret = libxl_device_vkb_hard_shutdown(ctx, Int_val(domid));
+ ret = libxl_device_vkb_destroy(ctx, Int_val(domid), &c_info);
if (ret != 0)
failwith_xl("vkb_hard_shutdown", &lg);
FREE_CTX();