}
CAMLprim value
-ocaml_guestfs_launch (value gv)
+ocaml_guestfs_test0 (value gv, value strv, value optstrv, value strlistv, value bv, value integerv, value fileinv, value fileoutv)
{
- CAMLparam1 (gv);
+ CAMLparam5 (gv, strv, optstrv, strlistv, bv);
+ CAMLxparam3 (integerv, fileinv, fileoutv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("launch: used handle after closing it");
-
+ caml_failwith ("test0: used handle after closing it");
+
+ const char *str = String_val (strv);
+ const char *optstr =
+ optstrv != Val_int (0) ? String_val (Field (optstrv, 0)) : NULL;
+ char **strlist = ocaml_guestfs_strings_val (g, strlistv);
+ int b = Bool_val (bv);
+ int integer = Int_val (integerv);
+ const char *filein = String_val (fileinv);
+ const char *fileout = String_val (fileoutv);
int r;
caml_enter_blocking_section ();
- r = guestfs_launch (g);
+ r = guestfs_test0 (g, str, optstr, strlist, b, integer, filein, fileout);
caml_leave_blocking_section ();
+ ocaml_guestfs_free_strings (strlist);
if (r == -1)
- ocaml_guestfs_raise_error (g, "launch");
+ ocaml_guestfs_raise_error (g, "test0");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_wait_ready (value gv)
+ocaml_guestfs_test0_byte (value *argv, int argn)
{
- CAMLparam1 (gv);
+ return ocaml_guestfs_test0 (argv[0], argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]);
+}
+
+CAMLprim value
+ocaml_guestfs_test0rint (value gv, value valv)
+{
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("wait_ready: used handle after closing it");
+ caml_failwith ("test0rint: used handle after closing it");
+ const char *val = String_val (valv);
int r;
caml_enter_blocking_section ();
- r = guestfs_wait_ready (g);
+ r = guestfs_test0rint (g, val);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "wait_ready");
+ ocaml_guestfs_raise_error (g, "test0rint");
- rv = Val_unit;
+ rv = Val_int (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_kill_subprocess (value gv)
+ocaml_guestfs_test0rinterr (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("kill_subprocess: used handle after closing it");
+ caml_failwith ("test0rinterr: used handle after closing it");
int r;
caml_enter_blocking_section ();
- r = guestfs_kill_subprocess (g);
+ r = guestfs_test0rinterr (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "kill_subprocess");
+ ocaml_guestfs_raise_error (g, "test0rinterr");
- rv = Val_unit;
+ rv = Val_int (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_add_drive (value gv, value filenamev)
+ocaml_guestfs_test0rint64 (value gv, value valv)
{
- CAMLparam2 (gv, filenamev);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("add_drive: used handle after closing it");
+ caml_failwith ("test0rint64: used handle after closing it");
- const char *filename = String_val (filenamev);
- int r;
+ const char *val = String_val (valv);
+ int64_t r;
caml_enter_blocking_section ();
- r = guestfs_add_drive (g, filename);
+ r = guestfs_test0rint64 (g, val);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "add_drive");
+ ocaml_guestfs_raise_error (g, "test0rint64");
- rv = Val_unit;
+ rv = caml_copy_int64 (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_add_cdrom (value gv, value filenamev)
+ocaml_guestfs_test0rint64err (value gv)
{
- CAMLparam2 (gv, filenamev);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("add_cdrom: used handle after closing it");
+ caml_failwith ("test0rint64err: used handle after closing it");
- const char *filename = String_val (filenamev);
- int r;
+ int64_t r;
caml_enter_blocking_section ();
- r = guestfs_add_cdrom (g, filename);
+ r = guestfs_test0rint64err (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "add_cdrom");
+ ocaml_guestfs_raise_error (g, "test0rint64err");
- rv = Val_unit;
+ rv = caml_copy_int64 (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_config (value gv, value qemuparamv, value qemuvaluev)
+ocaml_guestfs_test0rbool (value gv, value valv)
{
- CAMLparam3 (gv, qemuparamv, qemuvaluev);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("config: used handle after closing it");
+ caml_failwith ("test0rbool: used handle after closing it");
- const char *qemuparam = String_val (qemuparamv);
- const char *qemuvalue =
- qemuvaluev != Val_int (0) ? String_val (Field (qemuvaluev, 0)) : NULL;
+ const char *val = String_val (valv);
int r;
caml_enter_blocking_section ();
- r = guestfs_config (g, qemuparam, qemuvalue);
+ r = guestfs_test0rbool (g, val);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "config");
+ ocaml_guestfs_raise_error (g, "test0rbool");
- rv = Val_unit;
+ rv = Val_bool (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_set_qemu (value gv, value qemuv)
+ocaml_guestfs_test0rboolerr (value gv)
{
- CAMLparam2 (gv, qemuv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("set_qemu: used handle after closing it");
+ caml_failwith ("test0rboolerr: used handle after closing it");
- const char *qemu = String_val (qemuv);
int r;
caml_enter_blocking_section ();
- r = guestfs_set_qemu (g, qemu);
+ r = guestfs_test0rboolerr (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "set_qemu");
+ ocaml_guestfs_raise_error (g, "test0rboolerr");
- rv = Val_unit;
+ rv = Val_bool (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_get_qemu (value gv)
+ocaml_guestfs_test0rconststring (value gv, value valv)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("get_qemu: used handle after closing it");
+ caml_failwith ("test0rconststring: used handle after closing it");
+ const char *val = String_val (valv);
const char *r;
caml_enter_blocking_section ();
- r = guestfs_get_qemu (g);
+ r = guestfs_test0rconststring (g, val);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "get_qemu");
+ ocaml_guestfs_raise_error (g, "test0rconststring");
rv = caml_copy_string (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_set_path (value gv, value pathv)
+ocaml_guestfs_test0rconststringerr (value gv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("set_path: used handle after closing it");
+ caml_failwith ("test0rconststringerr: used handle after closing it");
- const char *path = String_val (pathv);
- int r;
+ const char *r;
caml_enter_blocking_section ();
- r = guestfs_set_path (g, path);
+ r = guestfs_test0rconststringerr (g);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "set_path");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rconststringerr");
- rv = Val_unit;
+ rv = caml_copy_string (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_get_path (value gv)
+ocaml_guestfs_test0rstring (value gv, value valv)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("get_path: used handle after closing it");
+ caml_failwith ("test0rstring: used handle after closing it");
- const char *r;
+ const char *val = String_val (valv);
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_get_path (g);
+ r = guestfs_test0rstring (g, val);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "get_path");
+ ocaml_guestfs_raise_error (g, "test0rstring");
rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_set_autosync (value gv, value autosyncv)
+ocaml_guestfs_test0rstringerr (value gv)
{
- CAMLparam2 (gv, autosyncv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("set_autosync: used handle after closing it");
+ caml_failwith ("test0rstringerr: used handle after closing it");
- int autosync = Bool_val (autosyncv);
- int r;
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_set_autosync (g, autosync);
+ r = guestfs_test0rstringerr (g);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "set_autosync");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rstringerr");
- rv = Val_unit;
+ rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_get_autosync (value gv)
+ocaml_guestfs_test0rstringlist (value gv, value valv)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("get_autosync: used handle after closing it");
+ caml_failwith ("test0rstringlist: used handle after closing it");
- int r;
+ const char *val = String_val (valv);
+ int i;
+ char **r;
caml_enter_blocking_section ();
- r = guestfs_get_autosync (g);
+ r = guestfs_test0rstringlist (g, val);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "get_autosync");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rstringlist");
- rv = Val_bool (r);
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_set_verbose (value gv, value verbosev)
+ocaml_guestfs_test0rstringlisterr (value gv)
{
- CAMLparam2 (gv, verbosev);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("set_verbose: used handle after closing it");
+ caml_failwith ("test0rstringlisterr: used handle after closing it");
- int verbose = Bool_val (verbosev);
- int r;
+ int i;
+ char **r;
caml_enter_blocking_section ();
- r = guestfs_set_verbose (g, verbose);
+ r = guestfs_test0rstringlisterr (g);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "set_verbose");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rstringlisterr");
- rv = Val_unit;
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_get_verbose (value gv)
+ocaml_guestfs_test0rintbool (value gv, value valv)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("get_verbose: used handle after closing it");
+ caml_failwith ("test0rintbool: used handle after closing it");
- int r;
+ const char *val = String_val (valv);
+ struct guestfs_int_bool *r;
caml_enter_blocking_section ();
- r = guestfs_get_verbose (g);
+ r = guestfs_test0rintbool (g, val);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "get_verbose");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rintbool");
- rv = Val_bool (r);
+ rv = caml_alloc (2, 0);
+ Store_field (rv, 0, Val_int (r->i));
+ Store_field (rv, 1, Val_bool (r->b));
+ guestfs_free_int_bool (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_is_ready (value gv)
+ocaml_guestfs_test0rintboolerr (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("is_ready: used handle after closing it");
+ caml_failwith ("test0rintboolerr: used handle after closing it");
- int r;
+ struct guestfs_int_bool *r;
caml_enter_blocking_section ();
- r = guestfs_is_ready (g);
+ r = guestfs_test0rintboolerr (g);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "is_ready");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rintboolerr");
- rv = Val_bool (r);
+ rv = caml_alloc (2, 0);
+ Store_field (rv, 0, Val_int (r->i));
+ Store_field (rv, 1, Val_bool (r->b));
+ guestfs_free_int_bool (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_is_config (value gv)
+ocaml_guestfs_test0rpvlist (value gv, value valv)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("is_config: used handle after closing it");
+ caml_failwith ("test0rpvlist: used handle after closing it");
- int r;
+ const char *val = String_val (valv);
+ struct guestfs_lvm_pv_list *r;
caml_enter_blocking_section ();
- r = guestfs_is_config (g);
+ r = guestfs_test0rpvlist (g, val);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "is_config");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rpvlist");
- rv = Val_bool (r);
+ rv = copy_lvm_pv_list (r);
+ guestfs_free_lvm_pv_list (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_is_launching (value gv)
+ocaml_guestfs_test0rpvlisterr (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("is_launching: used handle after closing it");
+ caml_failwith ("test0rpvlisterr: used handle after closing it");
- int r;
+ struct guestfs_lvm_pv_list *r;
caml_enter_blocking_section ();
- r = guestfs_is_launching (g);
+ r = guestfs_test0rpvlisterr (g);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "is_launching");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rpvlisterr");
- rv = Val_bool (r);
+ rv = copy_lvm_pv_list (r);
+ guestfs_free_lvm_pv_list (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_is_busy (value gv)
+ocaml_guestfs_test0rvglist (value gv, value valv)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("is_busy: used handle after closing it");
+ caml_failwith ("test0rvglist: used handle after closing it");
- int r;
+ const char *val = String_val (valv);
+ struct guestfs_lvm_vg_list *r;
caml_enter_blocking_section ();
- r = guestfs_is_busy (g);
+ r = guestfs_test0rvglist (g, val);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "is_busy");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rvglist");
- rv = Val_bool (r);
+ rv = copy_lvm_vg_list (r);
+ guestfs_free_lvm_vg_list (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_get_state (value gv)
+ocaml_guestfs_test0rvglisterr (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("get_state: used handle after closing it");
+ caml_failwith ("test0rvglisterr: used handle after closing it");
- int r;
+ struct guestfs_lvm_vg_list *r;
caml_enter_blocking_section ();
- r = guestfs_get_state (g);
+ r = guestfs_test0rvglisterr (g);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "get_state");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rvglisterr");
- rv = Val_int (r);
+ rv = copy_lvm_vg_list (r);
+ guestfs_free_lvm_vg_list (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_set_busy (value gv)
+ocaml_guestfs_test0rlvlist (value gv, value valv)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("set_busy: used handle after closing it");
+ caml_failwith ("test0rlvlist: used handle after closing it");
- int r;
+ const char *val = String_val (valv);
+ struct guestfs_lvm_lv_list *r;
caml_enter_blocking_section ();
- r = guestfs_set_busy (g);
+ r = guestfs_test0rlvlist (g, val);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "set_busy");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rlvlist");
- rv = Val_unit;
+ rv = copy_lvm_lv_list (r);
+ guestfs_free_lvm_lv_list (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_set_ready (value gv)
+ocaml_guestfs_test0rlvlisterr (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("set_ready: used handle after closing it");
+ caml_failwith ("test0rlvlisterr: used handle after closing it");
- int r;
+ struct guestfs_lvm_lv_list *r;
caml_enter_blocking_section ();
- r = guestfs_set_ready (g);
+ r = guestfs_test0rlvlisterr (g);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "set_ready");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rlvlisterr");
- rv = Val_unit;
+ rv = copy_lvm_lv_list (r);
+ guestfs_free_lvm_lv_list (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_mount (value gv, value devicev, value mountpointv)
+ocaml_guestfs_test0rstat (value gv, value valv)
{
- CAMLparam3 (gv, devicev, mountpointv);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("mount: used handle after closing it");
+ caml_failwith ("test0rstat: used handle after closing it");
- const char *device = String_val (devicev);
- const char *mountpoint = String_val (mountpointv);
- int r;
+ const char *val = String_val (valv);
+ struct guestfs_stat *r;
caml_enter_blocking_section ();
- r = guestfs_mount (g, device, mountpoint);
+ r = guestfs_test0rstat (g, val);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "mount");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rstat");
- rv = Val_unit;
+ rv = copy_stat (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_sync (value gv)
+ocaml_guestfs_test0rstaterr (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("sync: used handle after closing it");
+ caml_failwith ("test0rstaterr: used handle after closing it");
- int r;
+ struct guestfs_stat *r;
caml_enter_blocking_section ();
- r = guestfs_sync (g);
+ r = guestfs_test0rstaterr (g);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "sync");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rstaterr");
- rv = Val_unit;
+ rv = copy_stat (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_touch (value gv, value pathv)
+ocaml_guestfs_test0rstatvfs (value gv, value valv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("touch: used handle after closing it");
+ caml_failwith ("test0rstatvfs: used handle after closing it");
- const char *path = String_val (pathv);
- int r;
+ const char *val = String_val (valv);
+ struct guestfs_statvfs *r;
caml_enter_blocking_section ();
- r = guestfs_touch (g, path);
+ r = guestfs_test0rstatvfs (g, val);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "touch");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "test0rstatvfs");
- rv = Val_unit;
+ rv = copy_statvfs (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_cat (value gv, value pathv)
+ocaml_guestfs_test0rstatvfserr (value gv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("cat: used handle after closing it");
+ caml_failwith ("test0rstatvfserr: used handle after closing it");
- const char *path = String_val (pathv);
- char *r;
+ struct guestfs_statvfs *r;
caml_enter_blocking_section ();
- r = guestfs_cat (g, path);
+ r = guestfs_test0rstatvfserr (g);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "cat");
+ ocaml_guestfs_raise_error (g, "test0rstatvfserr");
- rv = caml_copy_string (r);
+ rv = copy_statvfs (r);
free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_ll (value gv, value directoryv)
+ocaml_guestfs_test0rhashtable (value gv, value valv)
{
- CAMLparam2 (gv, directoryv);
+ CAMLparam2 (gv, valv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("ll: used handle after closing it");
+ caml_failwith ("test0rhashtable: used handle after closing it");
- const char *directory = String_val (directoryv);
- char *r;
+ const char *val = String_val (valv);
+ int i;
+ char **r;
caml_enter_blocking_section ();
- r = guestfs_ll (g, directory);
+ r = guestfs_test0rhashtable (g, val);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "ll");
+ ocaml_guestfs_raise_error (g, "test0rhashtable");
- rv = caml_copy_string (r);
+ rv = copy_table (r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_ls (value gv, value directoryv)
+ocaml_guestfs_test0rhashtableerr (value gv)
{
- CAMLparam2 (gv, directoryv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("ls: used handle after closing it");
+ caml_failwith ("test0rhashtableerr: used handle after closing it");
- const char *directory = String_val (directoryv);
int i;
char **r;
caml_enter_blocking_section ();
- r = guestfs_ls (g, directory);
+ r = guestfs_test0rhashtableerr (g);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "ls");
+ ocaml_guestfs_raise_error (g, "test0rhashtableerr");
- rv = caml_copy_string_array ((const char **) r);
+ rv = copy_table (r);
for (i = 0; r[i] != NULL; ++i) free (r[i]);
free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_list_devices (value gv)
+ocaml_guestfs_launch (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("list_devices: used handle after closing it");
+ caml_failwith ("launch: used handle after closing it");
- int i;
- char **r;
+ int r;
caml_enter_blocking_section ();
- r = guestfs_list_devices (g);
+ r = guestfs_launch (g);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "list_devices");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "launch");
- rv = caml_copy_string_array ((const char **) r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_list_partitions (value gv)
+ocaml_guestfs_wait_ready (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("list_partitions: used handle after closing it");
+ caml_failwith ("wait_ready: used handle after closing it");
- int i;
- char **r;
+ int r;
caml_enter_blocking_section ();
- r = guestfs_list_partitions (g);
+ r = guestfs_wait_ready (g);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "list_partitions");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "wait_ready");
- rv = caml_copy_string_array ((const char **) r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_pvs (value gv)
+ocaml_guestfs_kill_subprocess (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("pvs: used handle after closing it");
+ caml_failwith ("kill_subprocess: used handle after closing it");
- int i;
- char **r;
+ int r;
caml_enter_blocking_section ();
- r = guestfs_pvs (g);
+ r = guestfs_kill_subprocess (g);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "pvs");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "kill_subprocess");
- rv = caml_copy_string_array ((const char **) r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_vgs (value gv)
+ocaml_guestfs_add_drive (value gv, value filenamev)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, filenamev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("vgs: used handle after closing it");
+ caml_failwith ("add_drive: used handle after closing it");
- int i;
- char **r;
+ const char *filename = String_val (filenamev);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_vgs (g);
+ r = guestfs_add_drive (g, filename);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "vgs");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "add_drive");
- rv = caml_copy_string_array ((const char **) r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_lvs (value gv)
+ocaml_guestfs_add_cdrom (value gv, value filenamev)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, filenamev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("lvs: used handle after closing it");
+ caml_failwith ("add_cdrom: used handle after closing it");
- int i;
- char **r;
+ const char *filename = String_val (filenamev);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_lvs (g);
+ r = guestfs_add_cdrom (g, filename);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "lvs");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "add_cdrom");
- rv = caml_copy_string_array ((const char **) r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_pvs_full (value gv)
+ocaml_guestfs_add_drive_ro (value gv, value filenamev)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, filenamev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("pvs_full: used handle after closing it");
+ caml_failwith ("add_drive_ro: used handle after closing it");
- struct guestfs_lvm_pv_list *r;
+ const char *filename = String_val (filenamev);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_pvs_full (g);
+ r = guestfs_add_drive_ro (g, filename);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "pvs_full");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "add_drive_ro");
- rv = copy_lvm_pv_list (r);
- guestfs_free_lvm_pv_list (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_vgs_full (value gv)
+ocaml_guestfs_config (value gv, value qemuparamv, value qemuvaluev)
{
- CAMLparam1 (gv);
+ CAMLparam3 (gv, qemuparamv, qemuvaluev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("vgs_full: used handle after closing it");
+ caml_failwith ("config: used handle after closing it");
- struct guestfs_lvm_vg_list *r;
+ const char *qemuparam = String_val (qemuparamv);
+ const char *qemuvalue =
+ qemuvaluev != Val_int (0) ? String_val (Field (qemuvaluev, 0)) : NULL;
+ int r;
caml_enter_blocking_section ();
- r = guestfs_vgs_full (g);
+ r = guestfs_config (g, qemuparam, qemuvalue);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "vgs_full");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "config");
- rv = copy_lvm_vg_list (r);
- guestfs_free_lvm_vg_list (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_lvs_full (value gv)
+ocaml_guestfs_set_qemu (value gv, value qemuv)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, qemuv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("lvs_full: used handle after closing it");
+ caml_failwith ("set_qemu: used handle after closing it");
- struct guestfs_lvm_lv_list *r;
+ const char *qemu = String_val (qemuv);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_lvs_full (g);
+ r = guestfs_set_qemu (g, qemu);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "lvs_full");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "set_qemu");
- rv = copy_lvm_lv_list (r);
- guestfs_free_lvm_lv_list (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_read_lines (value gv, value pathv)
+ocaml_guestfs_get_qemu (value gv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("read_lines: used handle after closing it");
+ caml_failwith ("get_qemu: used handle after closing it");
- const char *path = String_val (pathv);
- int i;
- char **r;
+ const char *r;
caml_enter_blocking_section ();
- r = guestfs_read_lines (g, path);
+ r = guestfs_get_qemu (g);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "read_lines");
+ ocaml_guestfs_raise_error (g, "get_qemu");
- rv = caml_copy_string_array ((const char **) r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
- free (r);
+ rv = caml_copy_string (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_init (value gv, value rootv, value flagsv)
+ocaml_guestfs_set_path (value gv, value pathv)
{
- CAMLparam3 (gv, rootv, flagsv);
+ CAMLparam2 (gv, pathv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_init: used handle after closing it");
+ caml_failwith ("set_path: used handle after closing it");
- const char *root = String_val (rootv);
- int flags = Int_val (flagsv);
+ const char *path = String_val (pathv);
int r;
caml_enter_blocking_section ();
- r = guestfs_aug_init (g, root, flags);
+ r = guestfs_set_path (g, path);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "aug_init");
+ ocaml_guestfs_raise_error (g, "set_path");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_close (value gv)
+ocaml_guestfs_get_path (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_close: used handle after closing it");
+ caml_failwith ("get_path: used handle after closing it");
- int r;
+ const char *r;
caml_enter_blocking_section ();
- r = guestfs_aug_close (g);
+ r = guestfs_get_path (g);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "aug_close");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "get_path");
- rv = Val_unit;
+ rv = caml_copy_string (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_defvar (value gv, value namev, value exprv)
+ocaml_guestfs_set_append (value gv, value appendv)
{
- CAMLparam3 (gv, namev, exprv);
+ CAMLparam2 (gv, appendv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_defvar: used handle after closing it");
+ caml_failwith ("set_append: used handle after closing it");
- const char *name = String_val (namev);
- const char *expr =
- exprv != Val_int (0) ? String_val (Field (exprv, 0)) : NULL;
+ const char *append = String_val (appendv);
int r;
caml_enter_blocking_section ();
- r = guestfs_aug_defvar (g, name, expr);
+ r = guestfs_set_append (g, append);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "aug_defvar");
+ ocaml_guestfs_raise_error (g, "set_append");
- rv = Val_int (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_defnode (value gv, value namev, value exprv, value valv)
+ocaml_guestfs_get_append (value gv)
{
- CAMLparam4 (gv, namev, exprv, valv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_defnode: used handle after closing it");
+ caml_failwith ("get_append: used handle after closing it");
- const char *name = String_val (namev);
- const char *expr = String_val (exprv);
- const char *val = String_val (valv);
- struct guestfs_int_bool *r;
+ const char *r;
caml_enter_blocking_section ();
- r = guestfs_aug_defnode (g, name, expr, val);
+ r = guestfs_get_append (g);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "aug_defnode");
+ ocaml_guestfs_raise_error (g, "get_append");
- rv = caml_alloc (2, 0);
- Store_field (rv, 0, Val_int (r->i));
- Store_field (rv, 1, Val_bool (r->b));
- guestfs_free_int_bool (r);
+ rv = caml_copy_string (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_get (value gv, value pathv)
+ocaml_guestfs_set_autosync (value gv, value autosyncv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam2 (gv, autosyncv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_get: used handle after closing it");
+ caml_failwith ("set_autosync: used handle after closing it");
- const char *path = String_val (pathv);
- char *r;
+ int autosync = Bool_val (autosyncv);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_aug_get (g, path);
+ r = guestfs_set_autosync (g, autosync);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "aug_get");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "set_autosync");
- rv = caml_copy_string (r);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_set (value gv, value pathv, value valv)
+ocaml_guestfs_get_autosync (value gv)
{
- CAMLparam3 (gv, pathv, valv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_set: used handle after closing it");
+ caml_failwith ("get_autosync: used handle after closing it");
- const char *path = String_val (pathv);
- const char *val = String_val (valv);
int r;
caml_enter_blocking_section ();
- r = guestfs_aug_set (g, path, val);
+ r = guestfs_get_autosync (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "aug_set");
+ ocaml_guestfs_raise_error (g, "get_autosync");
- rv = Val_unit;
+ rv = Val_bool (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_insert (value gv, value pathv, value labelv, value beforev)
+ocaml_guestfs_set_verbose (value gv, value verbosev)
{
- CAMLparam4 (gv, pathv, labelv, beforev);
+ CAMLparam2 (gv, verbosev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_insert: used handle after closing it");
+ caml_failwith ("set_verbose: used handle after closing it");
- const char *path = String_val (pathv);
- const char *label = String_val (labelv);
- int before = Bool_val (beforev);
+ int verbose = Bool_val (verbosev);
int r;
caml_enter_blocking_section ();
- r = guestfs_aug_insert (g, path, label, before);
+ r = guestfs_set_verbose (g, verbose);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "aug_insert");
+ ocaml_guestfs_raise_error (g, "set_verbose");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_rm (value gv, value pathv)
+ocaml_guestfs_get_verbose (value gv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_rm: used handle after closing it");
+ caml_failwith ("get_verbose: used handle after closing it");
- const char *path = String_val (pathv);
int r;
caml_enter_blocking_section ();
- r = guestfs_aug_rm (g, path);
+ r = guestfs_get_verbose (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "aug_rm");
+ ocaml_guestfs_raise_error (g, "get_verbose");
- rv = Val_int (r);
+ rv = Val_bool (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_mv (value gv, value srcv, value destv)
+ocaml_guestfs_is_ready (value gv)
{
- CAMLparam3 (gv, srcv, destv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_mv: used handle after closing it");
+ caml_failwith ("is_ready: used handle after closing it");
- const char *src = String_val (srcv);
- const char *dest = String_val (destv);
int r;
caml_enter_blocking_section ();
- r = guestfs_aug_mv (g, src, dest);
+ r = guestfs_is_ready (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "aug_mv");
+ ocaml_guestfs_raise_error (g, "is_ready");
- rv = Val_unit;
+ rv = Val_bool (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_match (value gv, value pathv)
+ocaml_guestfs_is_config (value gv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_match: used handle after closing it");
+ caml_failwith ("is_config: used handle after closing it");
- const char *path = String_val (pathv);
- int i;
- char **r;
+ int r;
caml_enter_blocking_section ();
- r = guestfs_aug_match (g, path);
+ r = guestfs_is_config (g);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "aug_match");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "is_config");
- rv = caml_copy_string_array ((const char **) r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
- free (r);
+ rv = Val_bool (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_save (value gv)
+ocaml_guestfs_is_launching (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_save: used handle after closing it");
+ caml_failwith ("is_launching: used handle after closing it");
int r;
caml_enter_blocking_section ();
- r = guestfs_aug_save (g);
+ r = guestfs_is_launching (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "aug_save");
+ ocaml_guestfs_raise_error (g, "is_launching");
- rv = Val_unit;
+ rv = Val_bool (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_load (value gv)
+ocaml_guestfs_is_busy (value gv)
{
CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_load: used handle after closing it");
+ caml_failwith ("is_busy: used handle after closing it");
int r;
caml_enter_blocking_section ();
- r = guestfs_aug_load (g);
+ r = guestfs_is_busy (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "aug_load");
+ ocaml_guestfs_raise_error (g, "is_busy");
- rv = Val_unit;
+ rv = Val_bool (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_aug_ls (value gv, value pathv)
+ocaml_guestfs_get_state (value gv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("aug_ls: used handle after closing it");
+ caml_failwith ("get_state: used handle after closing it");
- const char *path = String_val (pathv);
- int i;
- char **r;
+ int r;
caml_enter_blocking_section ();
- r = guestfs_aug_ls (g, path);
+ r = guestfs_get_state (g);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "aug_ls");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "get_state");
- rv = caml_copy_string_array ((const char **) r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
- free (r);
+ rv = Val_int (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_rm (value gv, value pathv)
+ocaml_guestfs_set_busy (value gv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("rm: used handle after closing it");
+ caml_failwith ("set_busy: used handle after closing it");
- const char *path = String_val (pathv);
int r;
caml_enter_blocking_section ();
- r = guestfs_rm (g, path);
+ r = guestfs_set_busy (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "rm");
+ ocaml_guestfs_raise_error (g, "set_busy");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_rmdir (value gv, value pathv)
+ocaml_guestfs_set_ready (value gv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("rmdir: used handle after closing it");
+ caml_failwith ("set_ready: used handle after closing it");
- const char *path = String_val (pathv);
int r;
caml_enter_blocking_section ();
- r = guestfs_rmdir (g, path);
+ r = guestfs_set_ready (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "rmdir");
+ ocaml_guestfs_raise_error (g, "set_ready");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_rm_rf (value gv, value pathv)
+ocaml_guestfs_end_busy (value gv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("rm_rf: used handle after closing it");
+ caml_failwith ("end_busy: used handle after closing it");
- const char *path = String_val (pathv);
int r;
caml_enter_blocking_section ();
- r = guestfs_rm_rf (g, path);
+ r = guestfs_end_busy (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "rm_rf");
+ ocaml_guestfs_raise_error (g, "end_busy");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_mkdir (value gv, value pathv)
+ocaml_guestfs_mount (value gv, value devicev, value mountpointv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam3 (gv, devicev, mountpointv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("mkdir: used handle after closing it");
+ caml_failwith ("mount: used handle after closing it");
- const char *path = String_val (pathv);
+ const char *device = String_val (devicev);
+ const char *mountpoint = String_val (mountpointv);
int r;
caml_enter_blocking_section ();
- r = guestfs_mkdir (g, path);
+ r = guestfs_mount (g, device, mountpoint);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "mkdir");
+ ocaml_guestfs_raise_error (g, "mount");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_mkdir_p (value gv, value pathv)
+ocaml_guestfs_sync (value gv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("mkdir_p: used handle after closing it");
+ caml_failwith ("sync: used handle after closing it");
- const char *path = String_val (pathv);
int r;
caml_enter_blocking_section ();
- r = guestfs_mkdir_p (g, path);
+ r = guestfs_sync (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "mkdir_p");
+ ocaml_guestfs_raise_error (g, "sync");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_chmod (value gv, value modev, value pathv)
+ocaml_guestfs_touch (value gv, value pathv)
{
- CAMLparam3 (gv, modev, pathv);
+ CAMLparam2 (gv, pathv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("chmod: used handle after closing it");
+ caml_failwith ("touch: used handle after closing it");
- int mode = Int_val (modev);
const char *path = String_val (pathv);
int r;
caml_enter_blocking_section ();
- r = guestfs_chmod (g, mode, path);
+ r = guestfs_touch (g, path);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "chmod");
+ ocaml_guestfs_raise_error (g, "touch");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_chown (value gv, value ownerv, value groupv, value pathv)
+ocaml_guestfs_cat (value gv, value pathv)
{
- CAMLparam4 (gv, ownerv, groupv, pathv);
+ CAMLparam2 (gv, pathv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("chown: used handle after closing it");
+ caml_failwith ("cat: used handle after closing it");
- int owner = Int_val (ownerv);
- int group = Int_val (groupv);
const char *path = String_val (pathv);
- int r;
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_chown (g, owner, group, path);
+ r = guestfs_cat (g, path);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "chown");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "cat");
- rv = Val_unit;
+ rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_exists (value gv, value pathv)
+ocaml_guestfs_ll (value gv, value directoryv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam2 (gv, directoryv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("exists: used handle after closing it");
+ caml_failwith ("ll: used handle after closing it");
- const char *path = String_val (pathv);
- int r;
+ const char *directory = String_val (directoryv);
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_exists (g, path);
+ r = guestfs_ll (g, directory);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "exists");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "ll");
- rv = Val_bool (r);
+ rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_is_file (value gv, value pathv)
+ocaml_guestfs_ls (value gv, value directoryv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam2 (gv, directoryv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("is_file: used handle after closing it");
+ caml_failwith ("ls: used handle after closing it");
+
+ const char *directory = String_val (directoryv);
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_ls (g, directory);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "ls");
+
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_list_devices (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("list_devices: used handle after closing it");
+
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_list_devices (g);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "list_devices");
+
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_list_partitions (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("list_partitions: used handle after closing it");
+
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_list_partitions (g);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "list_partitions");
+
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_pvs (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("pvs: used handle after closing it");
+
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_pvs (g);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "pvs");
+
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_vgs (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("vgs: used handle after closing it");
+
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_vgs (g);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "vgs");
+
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_lvs (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("lvs: used handle after closing it");
+
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_lvs (g);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "lvs");
+
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_pvs_full (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("pvs_full: used handle after closing it");
+
+ struct guestfs_lvm_pv_list *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_pvs_full (g);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "pvs_full");
+
+ rv = copy_lvm_pv_list (r);
+ guestfs_free_lvm_pv_list (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_vgs_full (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("vgs_full: used handle after closing it");
+
+ struct guestfs_lvm_vg_list *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_vgs_full (g);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "vgs_full");
+
+ rv = copy_lvm_vg_list (r);
+ guestfs_free_lvm_vg_list (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_lvs_full (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("lvs_full: used handle after closing it");
+
+ struct guestfs_lvm_lv_list *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_lvs_full (g);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "lvs_full");
+
+ rv = copy_lvm_lv_list (r);
+ guestfs_free_lvm_lv_list (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_read_lines (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("read_lines: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_read_lines (g, path);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "read_lines");
+
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_init (value gv, value rootv, value flagsv)
+{
+ CAMLparam3 (gv, rootv, flagsv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_init: used handle after closing it");
+
+ const char *root = String_val (rootv);
+ int flags = Int_val (flagsv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_init (g, root, flags);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "aug_init");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_close (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_close: used handle after closing it");
+
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_close (g);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "aug_close");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_defvar (value gv, value namev, value exprv)
+{
+ CAMLparam3 (gv, namev, exprv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_defvar: used handle after closing it");
+
+ const char *name = String_val (namev);
+ const char *expr =
+ exprv != Val_int (0) ? String_val (Field (exprv, 0)) : NULL;
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_defvar (g, name, expr);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "aug_defvar");
+
+ rv = Val_int (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_defnode (value gv, value namev, value exprv, value valv)
+{
+ CAMLparam4 (gv, namev, exprv, valv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_defnode: used handle after closing it");
+
+ const char *name = String_val (namev);
+ const char *expr = String_val (exprv);
+ const char *val = String_val (valv);
+ struct guestfs_int_bool *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_defnode (g, name, expr, val);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "aug_defnode");
+
+ rv = caml_alloc (2, 0);
+ Store_field (rv, 0, Val_int (r->i));
+ Store_field (rv, 1, Val_bool (r->b));
+ guestfs_free_int_bool (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_get (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_get: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ char *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_get (g, path);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "aug_get");
+
+ rv = caml_copy_string (r);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_set (value gv, value pathv, value valv)
+{
+ CAMLparam3 (gv, pathv, valv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_set: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ const char *val = String_val (valv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_set (g, path, val);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "aug_set");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_insert (value gv, value pathv, value labelv, value beforev)
+{
+ CAMLparam4 (gv, pathv, labelv, beforev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_insert: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ const char *label = String_val (labelv);
+ int before = Bool_val (beforev);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_insert (g, path, label, before);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "aug_insert");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_rm (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_rm: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_rm (g, path);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "aug_rm");
+
+ rv = Val_int (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_mv (value gv, value srcv, value destv)
+{
+ CAMLparam3 (gv, srcv, destv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_mv: used handle after closing it");
+
+ const char *src = String_val (srcv);
+ const char *dest = String_val (destv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_mv (g, src, dest);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "aug_mv");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_match (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_match: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_match (g, path);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "aug_match");
+
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_save (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_save: used handle after closing it");
+
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_save (g);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "aug_save");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_load (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_load: used handle after closing it");
+
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_load (g);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "aug_load");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_aug_ls (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("aug_ls: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_aug_ls (g, path);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "aug_ls");
+
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_rm (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("rm: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_rm (g, path);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "rm");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_rmdir (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("rmdir: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_rmdir (g, path);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "rmdir");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_rm_rf (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("rm_rf: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_rm_rf (g, path);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "rm_rf");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_mkdir (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("mkdir: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_mkdir (g, path);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "mkdir");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_mkdir_p (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("mkdir_p: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_mkdir_p (g, path);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "mkdir_p");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_chmod (value gv, value modev, value pathv)
+{
+ CAMLparam3 (gv, modev, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("chmod: used handle after closing it");
+
+ int mode = Int_val (modev);
+ const char *path = String_val (pathv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_chmod (g, mode, path);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "chmod");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_chown (value gv, value ownerv, value groupv, value pathv)
+{
+ CAMLparam4 (gv, ownerv, groupv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("chown: used handle after closing it");
+
+ int owner = Int_val (ownerv);
+ int group = Int_val (groupv);
+ const char *path = String_val (pathv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_chown (g, owner, group, path);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "chown");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_exists (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("exists: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_exists (g, path);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "exists");
+
+ rv = Val_bool (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_is_file (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("is_file: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_is_file (g, path);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "is_file");
+
+ rv = Val_bool (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_is_dir (value gv, value pathv)
+{
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("is_dir: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_is_dir (g, path);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "is_dir");
+
+ rv = Val_bool (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_pvcreate (value gv, value devicev)
+{
+ CAMLparam2 (gv, devicev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("pvcreate: used handle after closing it");
+
+ const char *device = String_val (devicev);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_pvcreate (g, device);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "pvcreate");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_vgcreate (value gv, value volgroupv, value physvolsv)
+{
+ CAMLparam3 (gv, volgroupv, physvolsv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("vgcreate: used handle after closing it");
+
+ const char *volgroup = String_val (volgroupv);
+ char **physvols = ocaml_guestfs_strings_val (g, physvolsv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_vgcreate (g, volgroup, physvols);
+ caml_leave_blocking_section ();
+ ocaml_guestfs_free_strings (physvols);
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "vgcreate");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_lvcreate (value gv, value logvolv, value volgroupv, value mbytesv)
+{
+ CAMLparam4 (gv, logvolv, volgroupv, mbytesv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("lvcreate: used handle after closing it");
+
+ const char *logvol = String_val (logvolv);
+ const char *volgroup = String_val (volgroupv);
+ int mbytes = Int_val (mbytesv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_lvcreate (g, logvol, volgroup, mbytes);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "lvcreate");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_mkfs (value gv, value fstypev, value devicev)
+{
+ CAMLparam3 (gv, fstypev, devicev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("mkfs: used handle after closing it");
+
+ const char *fstype = String_val (fstypev);
+ const char *device = String_val (devicev);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_mkfs (g, fstype, device);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "mkfs");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_sfdisk (value gv, value devicev, value cylsv, value headsv, value sectorsv, value linesv)
+{
+ CAMLparam5 (gv, devicev, cylsv, headsv, sectorsv);
+ CAMLxparam1 (linesv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("sfdisk: used handle after closing it");
+
+ const char *device = String_val (devicev);
+ int cyls = Int_val (cylsv);
+ int heads = Int_val (headsv);
+ int sectors = Int_val (sectorsv);
+ char **lines = ocaml_guestfs_strings_val (g, linesv);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_sfdisk (g, device, cyls, heads, sectors, lines);
+ caml_leave_blocking_section ();
+ ocaml_guestfs_free_strings (lines);
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "sfdisk");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_sfdisk_byte (value *argv, int argn)
+{
+ return ocaml_guestfs_sfdisk (argv[0], argv[0], argv[1], argv[2], argv[3], argv[4]);
+}
+
+CAMLprim value
+ocaml_guestfs_write_file (value gv, value pathv, value contentv, value sizev)
+{
+ CAMLparam4 (gv, pathv, contentv, sizev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("write_file: used handle after closing it");
const char *path = String_val (pathv);
+ const char *content = String_val (contentv);
+ int size = Int_val (sizev);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_write_file (g, path, content, size);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "write_file");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_umount (value gv, value pathordevicev)
+{
+ CAMLparam2 (gv, pathordevicev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("umount: used handle after closing it");
+
+ const char *pathordevice = String_val (pathordevicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_is_file (g, path);
+ r = guestfs_umount (g, pathordevice);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "umount");
+
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_mounts (value gv)
+{
+ CAMLparam1 (gv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("mounts: used handle after closing it");
+
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_mounts (g);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "is_file");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "mounts");
- rv = Val_bool (r);
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_is_dir (value gv, value pathv)
+ocaml_guestfs_umount_all (value gv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("is_dir: used handle after closing it");
+ caml_failwith ("umount_all: used handle after closing it");
- const char *path = String_val (pathv);
int r;
caml_enter_blocking_section ();
- r = guestfs_is_dir (g, path);
+ r = guestfs_umount_all (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "is_dir");
+ ocaml_guestfs_raise_error (g, "umount_all");
- rv = Val_bool (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_pvcreate (value gv, value devicev)
+ocaml_guestfs_lvm_remove_all (value gv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("pvcreate: used handle after closing it");
+ caml_failwith ("lvm_remove_all: used handle after closing it");
- const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_pvcreate (g, device);
+ r = guestfs_lvm_remove_all (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "pvcreate");
+ ocaml_guestfs_raise_error (g, "lvm_remove_all");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_vgcreate (value gv, value volgroupv, value physvolsv)
+ocaml_guestfs_file (value gv, value pathv)
{
- CAMLparam3 (gv, volgroupv, physvolsv);
+ CAMLparam2 (gv, pathv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("vgcreate: used handle after closing it");
+ caml_failwith ("file: used handle after closing it");
- const char *volgroup = String_val (volgroupv);
- char **physvols = ocaml_guestfs_strings_val (g, physvolsv);
- int r;
+ const char *path = String_val (pathv);
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_vgcreate (g, volgroup, physvols);
+ r = guestfs_file (g, path);
caml_leave_blocking_section ();
- ocaml_guestfs_free_strings (physvols);
- if (r == -1)
- ocaml_guestfs_raise_error (g, "vgcreate");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "file");
- rv = Val_unit;
+ rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_lvcreate (value gv, value logvolv, value volgroupv, value mbytesv)
+ocaml_guestfs_command (value gv, value argumentsv)
{
- CAMLparam4 (gv, logvolv, volgroupv, mbytesv);
+ CAMLparam2 (gv, argumentsv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("lvcreate: used handle after closing it");
+ caml_failwith ("command: used handle after closing it");
- const char *logvol = String_val (logvolv);
- const char *volgroup = String_val (volgroupv);
- int mbytes = Int_val (mbytesv);
- int r;
+ char **arguments = ocaml_guestfs_strings_val (g, argumentsv);
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_lvcreate (g, logvol, volgroup, mbytes);
+ r = guestfs_command (g, arguments);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "lvcreate");
+ ocaml_guestfs_free_strings (arguments);
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "command");
- rv = Val_unit;
+ rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_mkfs (value gv, value fstypev, value devicev)
+ocaml_guestfs_command_lines (value gv, value argumentsv)
{
- CAMLparam3 (gv, fstypev, devicev);
+ CAMLparam2 (gv, argumentsv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("mkfs: used handle after closing it");
+ caml_failwith ("command_lines: used handle after closing it");
- const char *fstype = String_val (fstypev);
- const char *device = String_val (devicev);
- int r;
+ char **arguments = ocaml_guestfs_strings_val (g, argumentsv);
+ int i;
+ char **r;
caml_enter_blocking_section ();
- r = guestfs_mkfs (g, fstype, device);
+ r = guestfs_command_lines (g, arguments);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "mkfs");
+ ocaml_guestfs_free_strings (arguments);
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "command_lines");
- rv = Val_unit;
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_sfdisk (value gv, value devicev, value cylsv, value headsv, value sectorsv, value linesv)
+ocaml_guestfs_stat (value gv, value pathv)
{
- CAMLparam5 (gv, devicev, cylsv, headsv, sectorsv);
- CAMLxparam1 (linesv);
+ CAMLparam2 (gv, pathv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("sfdisk: used handle after closing it");
+ caml_failwith ("stat: used handle after closing it");
- const char *device = String_val (devicev);
- int cyls = Int_val (cylsv);
- int heads = Int_val (headsv);
- int sectors = Int_val (sectorsv);
- char **lines = ocaml_guestfs_strings_val (g, linesv);
- int r;
+ const char *path = String_val (pathv);
+ struct guestfs_stat *r;
caml_enter_blocking_section ();
- r = guestfs_sfdisk (g, device, cyls, heads, sectors, lines);
+ r = guestfs_stat (g, path);
caml_leave_blocking_section ();
- ocaml_guestfs_free_strings (lines);
- if (r == -1)
- ocaml_guestfs_raise_error (g, "sfdisk");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "stat");
- rv = Val_unit;
+ rv = copy_stat (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_sfdisk_byte (value *argv, int argn)
+ocaml_guestfs_lstat (value gv, value pathv)
{
- return ocaml_guestfs_sfdisk (argv[0], argv[0], argv[1], argv[2], argv[3], argv[4]);
+ CAMLparam2 (gv, pathv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("lstat: used handle after closing it");
+
+ const char *path = String_val (pathv);
+ struct guestfs_stat *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_lstat (g, path);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "lstat");
+
+ rv = copy_stat (r);
+ free (r);
+ CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_write_file (value gv, value pathv, value contentv, value sizev)
+ocaml_guestfs_statvfs (value gv, value pathv)
{
- CAMLparam4 (gv, pathv, contentv, sizev);
+ CAMLparam2 (gv, pathv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("write_file: used handle after closing it");
+ caml_failwith ("statvfs: used handle after closing it");
const char *path = String_val (pathv);
- const char *content = String_val (contentv);
- int size = Int_val (sizev);
+ struct guestfs_statvfs *r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_statvfs (g, path);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "statvfs");
+
+ rv = copy_statvfs (r);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_tune2fs_l (value gv, value devicev)
+{
+ CAMLparam2 (gv, devicev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("tune2fs_l: used handle after closing it");
+
+ const char *device = String_val (devicev);
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_tune2fs_l (g, device);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "tune2fs_l");
+
+ rv = copy_table (r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_blockdev_setro (value gv, value devicev)
+{
+ CAMLparam2 (gv, devicev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("blockdev_setro: used handle after closing it");
+
+ const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_write_file (g, path, content, size);
+ r = guestfs_blockdev_setro (g, device);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "write_file");
+ ocaml_guestfs_raise_error (g, "blockdev_setro");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_umount (value gv, value pathordevicev)
+ocaml_guestfs_blockdev_setrw (value gv, value devicev)
{
- CAMLparam2 (gv, pathordevicev);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("umount: used handle after closing it");
+ caml_failwith ("blockdev_setrw: used handle after closing it");
- const char *pathordevice = String_val (pathordevicev);
+ const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_umount (g, pathordevice);
+ r = guestfs_blockdev_setrw (g, device);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "umount");
+ ocaml_guestfs_raise_error (g, "blockdev_setrw");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_mounts (value gv)
+ocaml_guestfs_blockdev_getro (value gv, value devicev)
+{
+ CAMLparam2 (gv, devicev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("blockdev_getro: used handle after closing it");
+
+ const char *device = String_val (devicev);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_blockdev_getro (g, device);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "blockdev_getro");
+
+ rv = Val_bool (r);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_blockdev_getss (value gv, value devicev)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("mounts: used handle after closing it");
+ caml_failwith ("blockdev_getss: used handle after closing it");
- int i;
- char **r;
+ const char *device = String_val (devicev);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_mounts (g);
+ r = guestfs_blockdev_getss (g, device);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "mounts");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "blockdev_getss");
- rv = caml_copy_string_array ((const char **) r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
- free (r);
+ rv = Val_int (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_umount_all (value gv)
+ocaml_guestfs_blockdev_getbsz (value gv, value devicev)
{
- CAMLparam1 (gv);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("umount_all: used handle after closing it");
+ caml_failwith ("blockdev_getbsz: used handle after closing it");
+ const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_umount_all (g);
+ r = guestfs_blockdev_getbsz (g, device);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "umount_all");
+ ocaml_guestfs_raise_error (g, "blockdev_getbsz");
- rv = Val_unit;
+ rv = Val_int (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_lvm_remove_all (value gv)
+ocaml_guestfs_blockdev_setbsz (value gv, value devicev, value blocksizev)
{
- CAMLparam1 (gv);
+ CAMLparam3 (gv, devicev, blocksizev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("lvm_remove_all: used handle after closing it");
+ caml_failwith ("blockdev_setbsz: used handle after closing it");
+ const char *device = String_val (devicev);
+ int blocksize = Int_val (blocksizev);
int r;
caml_enter_blocking_section ();
- r = guestfs_lvm_remove_all (g);
+ r = guestfs_blockdev_setbsz (g, device, blocksize);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "lvm_remove_all");
+ ocaml_guestfs_raise_error (g, "blockdev_setbsz");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_file (value gv, value pathv)
+ocaml_guestfs_blockdev_getsz (value gv, value devicev)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("file: used handle after closing it");
+ caml_failwith ("blockdev_getsz: used handle after closing it");
- const char *path = String_val (pathv);
- char *r;
+ const char *device = String_val (devicev);
+ int64_t r;
caml_enter_blocking_section ();
- r = guestfs_file (g, path);
+ r = guestfs_blockdev_getsz (g, device);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "file");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "blockdev_getsz");
- rv = caml_copy_string (r);
- free (r);
+ rv = caml_copy_int64 (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_command (value gv, value argumentsv)
+ocaml_guestfs_blockdev_getsize64 (value gv, value devicev)
{
- CAMLparam2 (gv, argumentsv);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("command: used handle after closing it");
+ caml_failwith ("blockdev_getsize64: used handle after closing it");
- char **arguments = ocaml_guestfs_strings_val (g, argumentsv);
- char *r;
+ const char *device = String_val (devicev);
+ int64_t r;
caml_enter_blocking_section ();
- r = guestfs_command (g, arguments);
+ r = guestfs_blockdev_getsize64 (g, device);
caml_leave_blocking_section ();
- ocaml_guestfs_free_strings (arguments);
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "command");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "blockdev_getsize64");
- rv = caml_copy_string (r);
- free (r);
+ rv = caml_copy_int64 (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_command_lines (value gv, value argumentsv)
+ocaml_guestfs_blockdev_flushbufs (value gv, value devicev)
{
- CAMLparam2 (gv, argumentsv);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("command_lines: used handle after closing it");
+ caml_failwith ("blockdev_flushbufs: used handle after closing it");
- char **arguments = ocaml_guestfs_strings_val (g, argumentsv);
- int i;
- char **r;
+ const char *device = String_val (devicev);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_command_lines (g, arguments);
+ r = guestfs_blockdev_flushbufs (g, device);
caml_leave_blocking_section ();
- ocaml_guestfs_free_strings (arguments);
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "command_lines");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "blockdev_flushbufs");
- rv = caml_copy_string_array ((const char **) r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_stat (value gv, value pathv)
+ocaml_guestfs_blockdev_rereadpt (value gv, value devicev)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("stat: used handle after closing it");
+ caml_failwith ("blockdev_rereadpt: used handle after closing it");
- const char *path = String_val (pathv);
- struct guestfs_stat *r;
+ const char *device = String_val (devicev);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_stat (g, path);
+ r = guestfs_blockdev_rereadpt (g, device);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "stat");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "blockdev_rereadpt");
- rv = copy_stat (r);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_lstat (value gv, value pathv)
+ocaml_guestfs_upload (value gv, value filenamev, value remotefilenamev)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam3 (gv, filenamev, remotefilenamev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("lstat: used handle after closing it");
+ caml_failwith ("upload: used handle after closing it");
- const char *path = String_val (pathv);
- struct guestfs_stat *r;
+ const char *filename = String_val (filenamev);
+ const char *remotefilename = String_val (remotefilenamev);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_lstat (g, path);
+ r = guestfs_upload (g, filename, remotefilename);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "lstat");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "upload");
- rv = copy_stat (r);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_statvfs (value gv, value pathv)
+ocaml_guestfs_download (value gv, value remotefilenamev, value filenamev)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam3 (gv, remotefilenamev, filenamev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("statvfs: used handle after closing it");
+ caml_failwith ("download: used handle after closing it");
- const char *path = String_val (pathv);
- struct guestfs_statvfs *r;
+ const char *remotefilename = String_val (remotefilenamev);
+ const char *filename = String_val (filenamev);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_statvfs (g, path);
+ r = guestfs_download (g, remotefilename, filename);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "statvfs");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "download");
- rv = copy_statvfs (r);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_tune2fs_l (value gv, value devicev)
+ocaml_guestfs_checksum (value gv, value csumtypev, value pathv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam3 (gv, csumtypev, pathv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("tune2fs_l: used handle after closing it");
+ caml_failwith ("checksum: used handle after closing it");
- const char *device = String_val (devicev);
- int i;
- char **r;
+ const char *csumtype = String_val (csumtypev);
+ const char *path = String_val (pathv);
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_tune2fs_l (g, device);
+ r = guestfs_checksum (g, csumtype, path);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "tune2fs_l");
+ ocaml_guestfs_raise_error (g, "checksum");
- rv = copy_table (r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ rv = caml_copy_string (r);
free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_blockdev_setro (value gv, value devicev)
+ocaml_guestfs_tar_in (value gv, value tarfilev, value directoryv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam3 (gv, tarfilev, directoryv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("blockdev_setro: used handle after closing it");
+ caml_failwith ("tar_in: used handle after closing it");
- const char *device = String_val (devicev);
+ const char *tarfile = String_val (tarfilev);
+ const char *directory = String_val (directoryv);
int r;
caml_enter_blocking_section ();
- r = guestfs_blockdev_setro (g, device);
+ r = guestfs_tar_in (g, tarfile, directory);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "blockdev_setro");
+ ocaml_guestfs_raise_error (g, "tar_in");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_blockdev_setrw (value gv, value devicev)
+ocaml_guestfs_tar_out (value gv, value directoryv, value tarfilev)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam3 (gv, directoryv, tarfilev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("blockdev_setrw: used handle after closing it");
+ caml_failwith ("tar_out: used handle after closing it");
- const char *device = String_val (devicev);
+ const char *directory = String_val (directoryv);
+ const char *tarfile = String_val (tarfilev);
int r;
caml_enter_blocking_section ();
- r = guestfs_blockdev_setrw (g, device);
+ r = guestfs_tar_out (g, directory, tarfile);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "blockdev_setrw");
+ ocaml_guestfs_raise_error (g, "tar_out");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_blockdev_getro (value gv, value devicev)
+ocaml_guestfs_tgz_in (value gv, value tarballv, value directoryv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam3 (gv, tarballv, directoryv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("blockdev_getro: used handle after closing it");
+ caml_failwith ("tgz_in: used handle after closing it");
- const char *device = String_val (devicev);
+ const char *tarball = String_val (tarballv);
+ const char *directory = String_val (directoryv);
int r;
caml_enter_blocking_section ();
- r = guestfs_blockdev_getro (g, device);
+ r = guestfs_tgz_in (g, tarball, directory);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "blockdev_getro");
+ ocaml_guestfs_raise_error (g, "tgz_in");
- rv = Val_bool (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_blockdev_getss (value gv, value devicev)
+ocaml_guestfs_tgz_out (value gv, value directoryv, value tarballv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam3 (gv, directoryv, tarballv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("blockdev_getss: used handle after closing it");
+ caml_failwith ("tgz_out: used handle after closing it");
- const char *device = String_val (devicev);
+ const char *directory = String_val (directoryv);
+ const char *tarball = String_val (tarballv);
int r;
caml_enter_blocking_section ();
- r = guestfs_blockdev_getss (g, device);
+ r = guestfs_tgz_out (g, directory, tarball);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "blockdev_getss");
+ ocaml_guestfs_raise_error (g, "tgz_out");
- rv = Val_int (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_blockdev_getbsz (value gv, value devicev)
+ocaml_guestfs_mount_ro (value gv, value devicev, value mountpointv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam3 (gv, devicev, mountpointv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("blockdev_getbsz: used handle after closing it");
+ caml_failwith ("mount_ro: used handle after closing it");
const char *device = String_val (devicev);
+ const char *mountpoint = String_val (mountpointv);
int r;
caml_enter_blocking_section ();
- r = guestfs_blockdev_getbsz (g, device);
+ r = guestfs_mount_ro (g, device, mountpoint);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "blockdev_getbsz");
+ ocaml_guestfs_raise_error (g, "mount_ro");
- rv = Val_int (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_blockdev_setbsz (value gv, value devicev, value blocksizev)
+ocaml_guestfs_mount_options (value gv, value optionsv, value devicev, value mountpointv)
{
- CAMLparam3 (gv, devicev, blocksizev);
+ CAMLparam4 (gv, optionsv, devicev, mountpointv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("blockdev_setbsz: used handle after closing it");
+ caml_failwith ("mount_options: used handle after closing it");
+ const char *options = String_val (optionsv);
const char *device = String_val (devicev);
- int blocksize = Int_val (blocksizev);
+ const char *mountpoint = String_val (mountpointv);
int r;
caml_enter_blocking_section ();
- r = guestfs_blockdev_setbsz (g, device, blocksize);
+ r = guestfs_mount_options (g, options, device, mountpoint);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "blockdev_setbsz");
+ ocaml_guestfs_raise_error (g, "mount_options");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_blockdev_getsz (value gv, value devicev)
+ocaml_guestfs_mount_vfs (value gv, value optionsv, value vfstypev, value devicev, value mountpointv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam5 (gv, optionsv, vfstypev, devicev, mountpointv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("blockdev_getsz: used handle after closing it");
+ caml_failwith ("mount_vfs: used handle after closing it");
+ const char *options = String_val (optionsv);
+ const char *vfstype = String_val (vfstypev);
const char *device = String_val (devicev);
- int64_t r;
+ const char *mountpoint = String_val (mountpointv);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_blockdev_getsz (g, device);
+ r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "blockdev_getsz");
+ ocaml_guestfs_raise_error (g, "mount_vfs");
- rv = caml_copy_int64 (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_blockdev_getsize64 (value gv, value devicev)
+ocaml_guestfs_debug (value gv, value subcmdv, value extraargsv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam3 (gv, subcmdv, extraargsv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("blockdev_getsize64: used handle after closing it");
+ caml_failwith ("debug: used handle after closing it");
- const char *device = String_val (devicev);
- int64_t r;
+ const char *subcmd = String_val (subcmdv);
+ char **extraargs = ocaml_guestfs_strings_val (g, extraargsv);
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_blockdev_getsize64 (g, device);
+ r = guestfs_debug (g, subcmd, extraargs);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "blockdev_getsize64");
+ ocaml_guestfs_free_strings (extraargs);
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "debug");
- rv = caml_copy_int64 (r);
+ rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_blockdev_flushbufs (value gv, value devicev)
+ocaml_guestfs_lvremove (value gv, value devicev)
{
CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("blockdev_flushbufs: used handle after closing it");
+ caml_failwith ("lvremove: used handle after closing it");
const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_blockdev_flushbufs (g, device);
+ r = guestfs_lvremove (g, device);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "blockdev_flushbufs");
+ ocaml_guestfs_raise_error (g, "lvremove");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_blockdev_rereadpt (value gv, value devicev)
+ocaml_guestfs_vgremove (value gv, value vgnamev)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam2 (gv, vgnamev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("blockdev_rereadpt: used handle after closing it");
+ caml_failwith ("vgremove: used handle after closing it");
- const char *device = String_val (devicev);
+ const char *vgname = String_val (vgnamev);
int r;
caml_enter_blocking_section ();
- r = guestfs_blockdev_rereadpt (g, device);
+ r = guestfs_vgremove (g, vgname);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "blockdev_rereadpt");
+ ocaml_guestfs_raise_error (g, "vgremove");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_upload (value gv, value filenamev, value remotefilenamev)
+ocaml_guestfs_pvremove (value gv, value devicev)
{
- CAMLparam3 (gv, filenamev, remotefilenamev);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("upload: used handle after closing it");
+ caml_failwith ("pvremove: used handle after closing it");
- const char *filename = String_val (filenamev);
- const char *remotefilename = String_val (remotefilenamev);
+ const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_upload (g, filename, remotefilename);
+ r = guestfs_pvremove (g, device);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "upload");
+ ocaml_guestfs_raise_error (g, "pvremove");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_download (value gv, value remotefilenamev, value filenamev)
+ocaml_guestfs_set_e2label (value gv, value devicev, value labelv)
{
- CAMLparam3 (gv, remotefilenamev, filenamev);
+ CAMLparam3 (gv, devicev, labelv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("download: used handle after closing it");
+ caml_failwith ("set_e2label: used handle after closing it");
- const char *remotefilename = String_val (remotefilenamev);
- const char *filename = String_val (filenamev);
+ const char *device = String_val (devicev);
+ const char *label = String_val (labelv);
int r;
caml_enter_blocking_section ();
- r = guestfs_download (g, remotefilename, filename);
+ r = guestfs_set_e2label (g, device, label);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "download");
+ ocaml_guestfs_raise_error (g, "set_e2label");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_checksum (value gv, value csumtypev, value pathv)
+ocaml_guestfs_get_e2label (value gv, value devicev)
{
- CAMLparam3 (gv, csumtypev, pathv);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("checksum: used handle after closing it");
+ caml_failwith ("get_e2label: used handle after closing it");
- const char *csumtype = String_val (csumtypev);
- const char *path = String_val (pathv);
+ const char *device = String_val (devicev);
char *r;
caml_enter_blocking_section ();
- r = guestfs_checksum (g, csumtype, path);
+ r = guestfs_get_e2label (g, device);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "checksum");
+ ocaml_guestfs_raise_error (g, "get_e2label");
rv = caml_copy_string (r);
free (r);
}
CAMLprim value
-ocaml_guestfs_tar_in (value gv, value tarfilev, value directoryv)
+ocaml_guestfs_set_e2uuid (value gv, value devicev, value uuidv)
{
- CAMLparam3 (gv, tarfilev, directoryv);
+ CAMLparam3 (gv, devicev, uuidv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("tar_in: used handle after closing it");
+ caml_failwith ("set_e2uuid: used handle after closing it");
- const char *tarfile = String_val (tarfilev);
- const char *directory = String_val (directoryv);
+ const char *device = String_val (devicev);
+ const char *uuid = String_val (uuidv);
int r;
caml_enter_blocking_section ();
- r = guestfs_tar_in (g, tarfile, directory);
+ r = guestfs_set_e2uuid (g, device, uuid);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "tar_in");
+ ocaml_guestfs_raise_error (g, "set_e2uuid");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_tar_out (value gv, value directoryv, value tarfilev)
+ocaml_guestfs_get_e2uuid (value gv, value devicev)
{
- CAMLparam3 (gv, directoryv, tarfilev);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("tar_out: used handle after closing it");
+ caml_failwith ("get_e2uuid: used handle after closing it");
- const char *directory = String_val (directoryv);
- const char *tarfile = String_val (tarfilev);
- int r;
+ const char *device = String_val (devicev);
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_tar_out (g, directory, tarfile);
+ r = guestfs_get_e2uuid (g, device);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "tar_out");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "get_e2uuid");
- rv = Val_unit;
+ rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_tgz_in (value gv, value tarballv, value directoryv)
+ocaml_guestfs_fsck (value gv, value fstypev, value devicev)
{
- CAMLparam3 (gv, tarballv, directoryv);
+ CAMLparam3 (gv, fstypev, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("tgz_in: used handle after closing it");
+ caml_failwith ("fsck: used handle after closing it");
- const char *tarball = String_val (tarballv);
- const char *directory = String_val (directoryv);
+ const char *fstype = String_val (fstypev);
+ const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_tgz_in (g, tarball, directory);
+ r = guestfs_fsck (g, fstype, device);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "tgz_in");
+ ocaml_guestfs_raise_error (g, "fsck");
- rv = Val_unit;
+ rv = Val_int (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_tgz_out (value gv, value directoryv, value tarballv)
+ocaml_guestfs_zero (value gv, value devicev)
{
- CAMLparam3 (gv, directoryv, tarballv);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("tgz_out: used handle after closing it");
+ caml_failwith ("zero: used handle after closing it");
- const char *directory = String_val (directoryv);
- const char *tarball = String_val (tarballv);
+ const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_tgz_out (g, directory, tarball);
+ r = guestfs_zero (g, device);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "tgz_out");
+ ocaml_guestfs_raise_error (g, "zero");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_mount_ro (value gv, value devicev, value mountpointv)
+ocaml_guestfs_grub_install (value gv, value rootv, value devicev)
{
- CAMLparam3 (gv, devicev, mountpointv);
+ CAMLparam3 (gv, rootv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("mount_ro: used handle after closing it");
+ caml_failwith ("grub_install: used handle after closing it");
+ const char *root = String_val (rootv);
const char *device = String_val (devicev);
- const char *mountpoint = String_val (mountpointv);
int r;
caml_enter_blocking_section ();
- r = guestfs_mount_ro (g, device, mountpoint);
+ r = guestfs_grub_install (g, root, device);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "mount_ro");
+ ocaml_guestfs_raise_error (g, "grub_install");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_mount_options (value gv, value optionsv, value devicev, value mountpointv)
+ocaml_guestfs_cp (value gv, value srcv, value destv)
{
- CAMLparam4 (gv, optionsv, devicev, mountpointv);
+ CAMLparam3 (gv, srcv, destv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("mount_options: used handle after closing it");
+ caml_failwith ("cp: used handle after closing it");
- const char *options = String_val (optionsv);
- const char *device = String_val (devicev);
- const char *mountpoint = String_val (mountpointv);
+ const char *src = String_val (srcv);
+ const char *dest = String_val (destv);
int r;
caml_enter_blocking_section ();
- r = guestfs_mount_options (g, options, device, mountpoint);
+ r = guestfs_cp (g, src, dest);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "mount_options");
+ ocaml_guestfs_raise_error (g, "cp");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_mount_vfs (value gv, value optionsv, value vfstypev, value devicev, value mountpointv)
+ocaml_guestfs_cp_a (value gv, value srcv, value destv)
{
- CAMLparam5 (gv, optionsv, vfstypev, devicev, mountpointv);
+ CAMLparam3 (gv, srcv, destv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("mount_vfs: used handle after closing it");
+ caml_failwith ("cp_a: used handle after closing it");
- const char *options = String_val (optionsv);
- const char *vfstype = String_val (vfstypev);
- const char *device = String_val (devicev);
- const char *mountpoint = String_val (mountpointv);
+ const char *src = String_val (srcv);
+ const char *dest = String_val (destv);
int r;
caml_enter_blocking_section ();
- r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint);
+ r = guestfs_cp_a (g, src, dest);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "mount_vfs");
+ ocaml_guestfs_raise_error (g, "cp_a");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_debug (value gv, value subcmdv, value extraargsv)
+ocaml_guestfs_mv (value gv, value srcv, value destv)
{
- CAMLparam3 (gv, subcmdv, extraargsv);
+ CAMLparam3 (gv, srcv, destv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("debug: used handle after closing it");
+ caml_failwith ("mv: used handle after closing it");
- const char *subcmd = String_val (subcmdv);
- char **extraargs = ocaml_guestfs_strings_val (g, extraargsv);
- char *r;
+ const char *src = String_val (srcv);
+ const char *dest = String_val (destv);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_debug (g, subcmd, extraargs);
+ r = guestfs_mv (g, src, dest);
caml_leave_blocking_section ();
- ocaml_guestfs_free_strings (extraargs);
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "debug");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "mv");
- rv = caml_copy_string (r);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_lvremove (value gv, value devicev)
+ocaml_guestfs_drop_caches (value gv, value whattodropv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam2 (gv, whattodropv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("lvremove: used handle after closing it");
+ caml_failwith ("drop_caches: used handle after closing it");
- const char *device = String_val (devicev);
+ int whattodrop = Int_val (whattodropv);
int r;
caml_enter_blocking_section ();
- r = guestfs_lvremove (g, device);
+ r = guestfs_drop_caches (g, whattodrop);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "lvremove");
+ ocaml_guestfs_raise_error (g, "drop_caches");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_vgremove (value gv, value vgnamev)
+ocaml_guestfs_dmesg (value gv)
{
- CAMLparam2 (gv, vgnamev);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("vgremove: used handle after closing it");
+ caml_failwith ("dmesg: used handle after closing it");
- const char *vgname = String_val (vgnamev);
- int r;
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_vgremove (g, vgname);
+ r = guestfs_dmesg (g);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "vgremove");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "dmesg");
- rv = Val_unit;
+ rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_pvremove (value gv, value devicev)
+ocaml_guestfs_ping_daemon (value gv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam1 (gv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("pvremove: used handle after closing it");
+ caml_failwith ("ping_daemon: used handle after closing it");
- const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_pvremove (g, device);
+ r = guestfs_ping_daemon (g);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "pvremove");
+ ocaml_guestfs_raise_error (g, "ping_daemon");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_set_e2label (value gv, value devicev, value labelv)
+ocaml_guestfs_equal (value gv, value file1v, value file2v)
{
- CAMLparam3 (gv, devicev, labelv);
+ CAMLparam3 (gv, file1v, file2v);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("set_e2label: used handle after closing it");
+ caml_failwith ("equal: used handle after closing it");
- const char *device = String_val (devicev);
- const char *label = String_val (labelv);
+ const char *file1 = String_val (file1v);
+ const char *file2 = String_val (file2v);
int r;
caml_enter_blocking_section ();
- r = guestfs_set_e2label (g, device, label);
+ r = guestfs_equal (g, file1, file2);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "set_e2label");
+ ocaml_guestfs_raise_error (g, "equal");
- rv = Val_unit;
+ rv = Val_bool (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_get_e2label (value gv, value devicev)
+ocaml_guestfs_strings (value gv, value pathv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam2 (gv, pathv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("get_e2label: used handle after closing it");
+ caml_failwith ("strings: used handle after closing it");
- const char *device = String_val (devicev);
- char *r;
+ const char *path = String_val (pathv);
+ int i;
+ char **r;
caml_enter_blocking_section ();
- r = guestfs_get_e2label (g, device);
+ r = guestfs_strings (g, path);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "get_e2label");
+ ocaml_guestfs_raise_error (g, "strings");
- rv = caml_copy_string (r);
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_set_e2uuid (value gv, value devicev, value uuidv)
+ocaml_guestfs_strings_e (value gv, value encodingv, value pathv)
{
- CAMLparam3 (gv, devicev, uuidv);
+ CAMLparam3 (gv, encodingv, pathv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("set_e2uuid: used handle after closing it");
+ caml_failwith ("strings_e: used handle after closing it");
- const char *device = String_val (devicev);
- const char *uuid = String_val (uuidv);
- int r;
+ const char *encoding = String_val (encodingv);
+ const char *path = String_val (pathv);
+ int i;
+ char **r;
caml_enter_blocking_section ();
- r = guestfs_set_e2uuid (g, device, uuid);
+ r = guestfs_strings_e (g, encoding, path);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "set_e2uuid");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "strings_e");
- rv = Val_unit;
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_get_e2uuid (value gv, value devicev)
+ocaml_guestfs_hexdump (value gv, value pathv)
{
- CAMLparam2 (gv, devicev);
+ CAMLparam2 (gv, pathv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("get_e2uuid: used handle after closing it");
+ caml_failwith ("hexdump: used handle after closing it");
- const char *device = String_val (devicev);
+ const char *path = String_val (pathv);
char *r;
caml_enter_blocking_section ();
- r = guestfs_get_e2uuid (g, device);
+ r = guestfs_hexdump (g, path);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "get_e2uuid");
+ ocaml_guestfs_raise_error (g, "hexdump");
rv = caml_copy_string (r);
free (r);
}
CAMLprim value
-ocaml_guestfs_fsck (value gv, value fstypev, value devicev)
+ocaml_guestfs_zerofree (value gv, value devicev)
{
- CAMLparam3 (gv, fstypev, devicev);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("fsck: used handle after closing it");
+ caml_failwith ("zerofree: used handle after closing it");
- const char *fstype = String_val (fstypev);
const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_fsck (g, fstype, device);
+ r = guestfs_zerofree (g, device);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "fsck");
+ ocaml_guestfs_raise_error (g, "zerofree");
- rv = Val_int (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_zero (value gv, value devicev)
+ocaml_guestfs_pvresize (value gv, value devicev)
{
CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("zero: used handle after closing it");
+ caml_failwith ("pvresize: used handle after closing it");
const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_zero (g, device);
+ r = guestfs_pvresize (g, device);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "zero");
+ ocaml_guestfs_raise_error (g, "pvresize");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_grub_install (value gv, value rootv, value devicev)
+ocaml_guestfs_sfdisk_N (value gv, value devicev, value nv, value cylsv, value headsv, value sectorsv, value linev)
{
- CAMLparam3 (gv, rootv, devicev);
+ CAMLparam5 (gv, devicev, nv, cylsv, headsv);
+ CAMLxparam2 (sectorsv, linev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("grub_install: used handle after closing it");
+ caml_failwith ("sfdisk_N: used handle after closing it");
- const char *root = String_val (rootv);
const char *device = String_val (devicev);
+ int n = Int_val (nv);
+ int cyls = Int_val (cylsv);
+ int heads = Int_val (headsv);
+ int sectors = Int_val (sectorsv);
+ const char *line = String_val (linev);
int r;
caml_enter_blocking_section ();
- r = guestfs_grub_install (g, root, device);
+ r = guestfs_sfdisk_N (g, device, n, cyls, heads, sectors, line);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "grub_install");
+ ocaml_guestfs_raise_error (g, "sfdisk_N");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_cp (value gv, value srcv, value destv)
+ocaml_guestfs_sfdisk_N_byte (value *argv, int argn)
{
- CAMLparam3 (gv, srcv, destv);
+ return ocaml_guestfs_sfdisk_N (argv[0], argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
+}
+
+CAMLprim value
+ocaml_guestfs_sfdisk_l (value gv, value devicev)
+{
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("cp: used handle after closing it");
+ caml_failwith ("sfdisk_l: used handle after closing it");
- const char *src = String_val (srcv);
- const char *dest = String_val (destv);
- int r;
+ const char *device = String_val (devicev);
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_cp (g, src, dest);
+ r = guestfs_sfdisk_l (g, device);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "cp");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "sfdisk_l");
- rv = Val_unit;
+ rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_cp_a (value gv, value srcv, value destv)
+ocaml_guestfs_sfdisk_kernel_geometry (value gv, value devicev)
{
- CAMLparam3 (gv, srcv, destv);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("cp_a: used handle after closing it");
+ caml_failwith ("sfdisk_kernel_geometry: used handle after closing it");
- const char *src = String_val (srcv);
- const char *dest = String_val (destv);
- int r;
+ const char *device = String_val (devicev);
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_cp_a (g, src, dest);
+ r = guestfs_sfdisk_kernel_geometry (g, device);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "cp_a");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "sfdisk_kernel_geometry");
- rv = Val_unit;
+ rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_mv (value gv, value srcv, value destv)
+ocaml_guestfs_sfdisk_disk_geometry (value gv, value devicev)
{
- CAMLparam3 (gv, srcv, destv);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("mv: used handle after closing it");
+ caml_failwith ("sfdisk_disk_geometry: used handle after closing it");
- const char *src = String_val (srcv);
- const char *dest = String_val (destv);
- int r;
+ const char *device = String_val (devicev);
+ char *r;
caml_enter_blocking_section ();
- r = guestfs_mv (g, src, dest);
+ r = guestfs_sfdisk_disk_geometry (g, device);
caml_leave_blocking_section ();
- if (r == -1)
- ocaml_guestfs_raise_error (g, "mv");
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "sfdisk_disk_geometry");
- rv = Val_unit;
+ rv = caml_copy_string (r);
+ free (r);
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_drop_caches (value gv, value whattodropv)
+ocaml_guestfs_vg_activate_all (value gv, value activatev)
{
- CAMLparam2 (gv, whattodropv);
+ CAMLparam2 (gv, activatev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("drop_caches: used handle after closing it");
+ caml_failwith ("vg_activate_all: used handle after closing it");
- int whattodrop = Int_val (whattodropv);
+ int activate = Bool_val (activatev);
int r;
caml_enter_blocking_section ();
- r = guestfs_drop_caches (g, whattodrop);
+ r = guestfs_vg_activate_all (g, activate);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "drop_caches");
+ ocaml_guestfs_raise_error (g, "vg_activate_all");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_dmesg (value gv)
+ocaml_guestfs_vg_activate (value gv, value activatev, value volgroupsv)
{
- CAMLparam1 (gv);
+ CAMLparam3 (gv, activatev, volgroupsv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("dmesg: used handle after closing it");
+ caml_failwith ("vg_activate: used handle after closing it");
- char *r;
+ int activate = Bool_val (activatev);
+ char **volgroups = ocaml_guestfs_strings_val (g, volgroupsv);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_dmesg (g);
+ r = guestfs_vg_activate (g, activate, volgroups);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "dmesg");
+ ocaml_guestfs_free_strings (volgroups);
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "vg_activate");
- rv = caml_copy_string (r);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_ping_daemon (value gv)
+ocaml_guestfs_lvresize (value gv, value devicev, value mbytesv)
{
- CAMLparam1 (gv);
+ CAMLparam3 (gv, devicev, mbytesv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("ping_daemon: used handle after closing it");
+ caml_failwith ("lvresize: used handle after closing it");
+ const char *device = String_val (devicev);
+ int mbytes = Int_val (mbytesv);
int r;
caml_enter_blocking_section ();
- r = guestfs_ping_daemon (g);
+ r = guestfs_lvresize (g, device, mbytes);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "ping_daemon");
+ ocaml_guestfs_raise_error (g, "lvresize");
rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_equal (value gv, value file1v, value file2v)
+ocaml_guestfs_resize2fs (value gv, value devicev)
{
- CAMLparam3 (gv, file1v, file2v);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("equal: used handle after closing it");
+ caml_failwith ("resize2fs: used handle after closing it");
- const char *file1 = String_val (file1v);
- const char *file2 = String_val (file2v);
+ const char *device = String_val (devicev);
int r;
caml_enter_blocking_section ();
- r = guestfs_equal (g, file1, file2);
+ r = guestfs_resize2fs (g, device);
caml_leave_blocking_section ();
if (r == -1)
- ocaml_guestfs_raise_error (g, "equal");
+ ocaml_guestfs_raise_error (g, "resize2fs");
- rv = Val_bool (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_strings (value gv, value pathv)
+ocaml_guestfs_find (value gv, value directoryv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam2 (gv, directoryv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("strings: used handle after closing it");
+ caml_failwith ("find: used handle after closing it");
- const char *path = String_val (pathv);
+ const char *directory = String_val (directoryv);
int i;
char **r;
caml_enter_blocking_section ();
- r = guestfs_strings (g, path);
+ r = guestfs_find (g, directory);
caml_leave_blocking_section ();
if (r == NULL)
- ocaml_guestfs_raise_error (g, "strings");
+ ocaml_guestfs_raise_error (g, "find");
rv = caml_copy_string_array ((const char **) r);
for (i = 0; r[i] != NULL; ++i) free (r[i]);
}
CAMLprim value
-ocaml_guestfs_strings_e (value gv, value encodingv, value pathv)
+ocaml_guestfs_e2fsck_f (value gv, value devicev)
{
- CAMLparam3 (gv, encodingv, pathv);
+ CAMLparam2 (gv, devicev);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("strings_e: used handle after closing it");
+ caml_failwith ("e2fsck_f: used handle after closing it");
- const char *encoding = String_val (encodingv);
- const char *path = String_val (pathv);
- int i;
- char **r;
+ const char *device = String_val (devicev);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_strings_e (g, encoding, path);
+ r = guestfs_e2fsck_f (g, device);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "strings_e");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "e2fsck_f");
- rv = caml_copy_string_array ((const char **) r);
- for (i = 0; r[i] != NULL; ++i) free (r[i]);
- free (r);
+ rv = Val_unit;
CAMLreturn (rv);
}
CAMLprim value
-ocaml_guestfs_hexdump (value gv, value pathv)
+ocaml_guestfs_sleep (value gv, value secsv)
{
- CAMLparam2 (gv, pathv);
+ CAMLparam2 (gv, secsv);
CAMLlocal1 (rv);
guestfs_h *g = Guestfs_val (gv);
if (g == NULL)
- caml_failwith ("hexdump: used handle after closing it");
+ caml_failwith ("sleep: used handle after closing it");
- const char *path = String_val (pathv);
- char *r;
+ int secs = Int_val (secsv);
+ int r;
caml_enter_blocking_section ();
- r = guestfs_hexdump (g, path);
+ r = guestfs_sleep (g, secs);
caml_leave_blocking_section ();
- if (r == NULL)
- ocaml_guestfs_raise_error (g, "hexdump");
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "sleep");
- rv = caml_copy_string (r);
- free (r);
+ rv = Val_unit;
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_ntfs_3g_probe (value gv, value rwv, value devicev)
+{
+ CAMLparam3 (gv, rwv, devicev);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("ntfs_3g_probe: used handle after closing it");
+
+ int rw = Bool_val (rwv);
+ const char *device = String_val (devicev);
+ int r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_ntfs_3g_probe (g, rw, device);
+ caml_leave_blocking_section ();
+ if (r == -1)
+ ocaml_guestfs_raise_error (g, "ntfs_3g_probe");
+
+ rv = Val_int (r);
CAMLreturn (rv);
}