summaryrefslogtreecommitdiffstats
path: root/ocaml/guestfs_c_actions.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-27 13:41:59 +0100
committerRichard Jones <rjones@redhat.com>2009-04-27 13:41:59 +0100
commitb03ee3675bed8d739ae722ed8c030ae02b3cb0ed (patch)
treef5023b4c49af30258b76f187fbbcb11f5dbad708 /ocaml/guestfs_c_actions.c
parentafca1dba5eeb989c231a22df26e48f0967387547 (diff)
downloadlibguestfs-b03ee3675bed8d739ae722ed8c030ae02b3cb0ed.tar.gz
libguestfs-b03ee3675bed8d739ae722ed8c030ae02b3cb0ed.tar.xz
libguestfs-b03ee3675bed8d739ae722ed8c030ae02b3cb0ed.zip
Generated code for ext2 UUID and label functions.
Diffstat (limited to 'ocaml/guestfs_c_actions.c')
-rw-r--r--ocaml/guestfs_c_actions.c96
1 files changed, 96 insertions, 0 deletions
diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c
index 73515cfc..b8c07878 100644
--- a/ocaml/guestfs_c_actions.c
+++ b/ocaml/guestfs_c_actions.c
@@ -2703,3 +2703,99 @@ ocaml_guestfs_pvremove (value gv, value devicev)
CAMLreturn (rv);
}
+CAMLprim value
+ocaml_guestfs_set_e2label (value gv, value devicev, value labelv)
+{
+ CAMLparam3 (gv, devicev, labelv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("set_e2label: used handle after closing it");
+
+ const char *device = String_val (devicev);
+ const char *label = String_val (labelv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_set_e2label (g, device, label);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "set_e2label");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_get_e2label (value gv, value devicev)
+{
+ CAMLparam2 (gv, devicev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("get_e2label: used handle after closing it");
+
+ const char *device = String_val (devicev);
+ char *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_get_e2label (g, device);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "get_e2label");
+
+ rv = caml_copy_string (r);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_set_e2uuid (value gv, value devicev, value uuidv)
+{
+ CAMLparam3 (gv, devicev, uuidv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("set_e2uuid: used handle after closing it");
+
+ const char *device = String_val (devicev);
+ const char *uuid = String_val (uuidv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_set_e2uuid (g, device, uuid);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "set_e2uuid");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_get_e2uuid (value gv, value devicev)
+{
+ CAMLparam2 (gv, devicev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("get_e2uuid: used handle after closing it");
+
+ const char *device = String_val (devicev);
+ char *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_get_e2uuid (g, device);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "get_e2uuid");
+
+ rv = caml_copy_string (r);
+ free (r);
+ CAMLreturn (rv);
+}
+