Displaying 20 results from an estimated 52 matches for "mountable_or_path".
2014 Feb 10
5
[PATCH 0/4] add GUID validation (RHBZ#1008417)
Hi,
this patch serie adds a new GUID type in the generator, which would do
the same as String, but also validating (just in the C output) the
passed GUID string.
This allows to reject invalid GUIDs before passing them to low-level
tools.
Pino Toscano (4):
utils: add a function to validate a GUID string
generator: add a GUID parameter type
generator: generate code for parameter validation
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
This type is initially identical to Device.
---
generator/bindtests.ml | 2 +-
generator/c.ml | 7 +++++--
generator/csharp.ml | 6 ++++--
generator/daemon.ml | 4 ++--
generator/erlang.ml | 6 +++---
generator/fish.ml | 8 ++++----
generator/gobject.ml | 11 ++++++-----
generator/haskell.ml | 11 +++++++----
generator/java.ml | 10 +++++-----
2017 Apr 21
4
[PATCH 0/2] generator: Simplify the handling of string parameters.
Very large but mechanical change to the generator.
Rich.
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...Object.ml
+++ b/generator/GObject.ml
@@ -77,19 +77,10 @@ let generate_gobject_proto name ?(single_line = true)
pr "gint32 %s" n
| Int64 n->
pr "gint64 %s" n
- | String n
- | Device n | Mountable n
- | Pathname n
- | Dev_or_Path n | Mountable_or_Path n
- | OptString n
- | Key n
- | FileIn n
- | FileOut n
- | GUID n ->
+ | String (_, n)
+ | OptString n ->
pr "const gchar *%s" n
- | StringList n
- | DeviceList n
- | FilenameList n ->
+ | StringList (_, n) ->...
2015 Oct 20
3
[PATCH 1/2] generator: add a RelativePathnameList parameter type
...| Bool n ->
next (); pr "bool %s" n
diff --git a/generator/daemon.ml b/generator/daemon.ml
index 1825de4..e6093a3 100644
--- a/generator/daemon.ml
+++ b/generator/daemon.ml
@@ -255,7 +255,7 @@ cleanup_free_mountable (mountable_t *mountable)
| Mountable n | Mountable_or_Path n ->
pr " CLEANUP_FREE_MOUNTABLE mountable_t %s\n" n;
pr " = { .device = NULL, .volume = NULL };\n"
- | StringList n ->
+ | StringList n | RelativePathnameList n ->
pr " char **%s;\n" n...
2015 Oct 21
2
[PATCH 1/2] generator: add a FilenameList parameter type
...| Bool n ->
next (); pr "bool %s" n
diff --git a/generator/daemon.ml b/generator/daemon.ml
index 1825de4..a950c17 100644
--- a/generator/daemon.ml
+++ b/generator/daemon.ml
@@ -255,7 +255,7 @@ cleanup_free_mountable (mountable_t *mountable)
| Mountable n | Mountable_or_Path n ->
pr " CLEANUP_FREE_MOUNTABLE mountable_t %s\n" n;
pr " = { .device = NULL, .volume = NULL };\n"
- | StringList n ->
+ | StringList n | FilenameList n ->
pr " char **%s;\n" n
| Devic...
[PATCH 18/27] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
2017 Jul 14
0
[PATCH 18/27] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
...e temporary directory. This is called on error and
+ * ordinary exit paths.
+ *)
+ let finally () =
+ ignore (Sys.command (sprintf "umount %s" (quote tmpdir)));
+ rmdir tmpdir
+ in
+
+ match mountable.m_type with
+ | MountablePath ->
+ (* This corner-case happens for Mountable_or_Path parameters, where
+ * a path was supplied by the caller. The path (the m_device
+ * field) is relative to the sysroot.
+ *)
+ f (Sysroot.sysroot () // mountable.m_device)
+
+ | MountableDevice ->
+ protect ~finally ~f:(
+ fun () ->
+ mkdir tmpdir 0o700;...
2017 Jul 21
0
[PATCH v2 15/23] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
...oot, as something else might be mounted
+ * there so this function mounts the filesystem on a temporary
+ * directory and ensures it is always unmounted afterwards.
+ *)
+let rec with_mounted mountable f =
+ match mountable.m_type with
+ | MountablePath ->
+ (* This corner-case happens for Mountable_or_Path parameters, where
+ * a path was supplied by the caller. The path (the m_device
+ * field) is relative to the sysroot.
+ *)
+ f (Sysroot.sysroot_path mountable.m_device)
+
+ | MountableDevice ->
+ let cmd tmpdir =
+ ignore (command "mount" [mountable.m_de...
2017 May 04
1
[PATCH] perl: drop %guestfs_introspection stuff
...s', 'string(device)', %d ]" n i
- | String (Mountable, n) -> pr "[ '%s', 'string(mountable)', %d ]" n i
- | String (Dev_or_Path, n) ->
- pr "[ '%s', 'string(dev_or_path)', %d ]" n i
- | String (Mountable_or_Path, n) ->
- pr "[ '%s', 'string(mountable_or_path)', %d ]" n i
- | String (GUID, n) -> pr "[ '%s', 'guid', %d ]" n i
- | String ((FileIn|FileOut), n) ->
- pr "[ '%s', 'string(filename)',...
2015 Feb 10
4
[PATCH 1/4] php: fix invalid memory access with OptString
...13 insertions(+), 2 deletions(-)
diff --git a/generator/php.ml b/generator/php.ml
index 0ef6541..1384451 100644
--- a/generator/php.ml
+++ b/generator/php.ml
@@ -192,11 +192,13 @@ PHP_FUNCTION (guestfs_last_error)
| String n | Device n | Mountable n | Pathname n
| Dev_or_Path n | Mountable_or_Path n
| FileIn n | FileOut n | Key n
- | OptString n
| BufferIn n
| GUID n ->
pr " char *%s;\n" n;
pr " int %s_size;\n" n
+ | OptString n ->
+ pr " char *%s = NULL;\n" n;
+ pr...
2017 Apr 21
0
[PATCH 2/2] generator: Don't permit certain String/stringt combinations.
...ameList were special list
+ * types. We could permit more here in future.
+ *)
+ | StringList (FileIn, _)
+ | StringList (FileOut, _)
+ | StringList (Mountable, _)
+ | StringList (Pathname, _)
+ | StringList (Dev_or_Path, _)
+ | StringList (Mountable_or_Path, _)
+ | StringList (Key, _)
+ | StringList (GUID, _) ->
+ failwithf "StringList (t, _) is not permitted for %s." name
+ | _ -> ()
+ in
+ List.iter check_arg_type args
+ ) actions;
+
(* Check short descriptions. *)
List.iter (
fun...
2019 May 29
0
[PATCH 3/3] daemon: implement OptString for OCaml APIs
...optv = caml_alloc (1, 0);
+ Field (optv, 0) = v;
+ } else /* Return None */
+ optv = Val_int (0);
+
+ CAMLreturn (optv);
+}
+
";
(* Implement code for returning structs and struct lists. *)
@@ -797,7 +813,7 @@ let generate_daemon_caml_stubs () =
| String ((Mountable|Mountable_or_Path), n) ->
pr "guestfs_int_daemon_copy_mountable (%s)" n
| String _ -> assert false
- | OptString _ -> assert false
+ | OptString n -> pr "Val_optstring (%s)" n
| StringList _ -> assert false
| Bu...
2014 Dec 11
0
[PATCH v2 02/11] New API: btrfs_subvolume_get_default
...4
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -12032,6 +12032,24 @@ Set readahead (in 512-byte sectors) for the device.
This uses the L<blockdev(8)> command." };
+ { defaults with
+ name = "btrfs_subvolume_get_default";
+ style = RInt64 "id", [Mountable_or_Path "fs"], [];
+ proc_nr = Some 425;
+ optional = Some "btrfs"; camel_name = "BTRFSSubvolumeGetDefault";
+ tests = [
+ InitPartition, Always, TestResult (
+ [["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG";...
2014 Dec 11
14
[PATCH v2 00/11] btrfs support part2: qgroup/quota commands
Hi,
This is v2 series to add support to btrfs qgroup related commands, inclduing
quota commands, and two leftover of subvolume commands.
Regards,
Hu
changes:
v2:
- add tests for new APIs
- combine btrfs_quota_enable and btrfs_quota_disable
- following APIs changed to operate on Mountable_or_Path:
btrfs_subvolume_get_default, btrfs_quota_enable, btrfs_quota_rescan.
Hu Tao (11):
daemon: btrfs: add helper functions mount and umount
New API: btrfs_subvolume_get_default
New API: btrfs_subvolume_show
New API: btrfs_quota_enable
New API: btrfs_quota_rescan
New API: btrfs_qgroup_l...
2017 Apr 20
6
[PATCH 0/5] generator: daemon: Various simplifications to stubs code.
This is a series of simplifications to the stubs code.
It's all refactoring, there is no functional change.
Rich.
2014 Dec 12
15
[PATCH v3 00/11] btrfs support part2: qgroup/quota commands
...tialize fs_buf (patch 1)
- check the return value of sysroot_path (patch 1)
- check fs_buf rather than fs (patch 1)
- fprintf (stderr,...) -> reply_with_error()
v2:
- add tests for new APIs
- combine btrfs_quota_enable and btrfs_quota_disable
- following APIs changed to operate on Mountable_or_Path:
btrfs_subvolume_get_default, btrfs_quota_enable, btrfs_quota_rescan.
Hu Tao (11):
daemon: btrfs: add helper functions mount and umount
New API: btrfs_subvolume_get_default
New API: btrfs_subvolume_show
New API: btrfs_quota_enable
New API: btrfs_quota_rescan
New API: btrfs_qgroup...
2019 May 29
4
[PATCH 0/3] Simple augeas-related changes
- bump the augeas requirement to 1.2.0, and drop an old hack
- add a small helper in the generator
Pino Toscano (3):
build: raise augeas requirement to 1.2.0
appliance: remove custom Shadow augeas lens
daemon: implement OptString for OCaml APIs
appliance/Makefile.am | 6 +--
appliance/guestfs_shadow.aug | 72 ------------------------------------
daemon/augeas.c | 21
2018 Apr 09
5
[PATCH 0/3] daemon: generate almost all the API OCaml interfaces
Hi,
as a followup for the signature fix for mount_vfs [1], here it is a
patch series to generate automatically most of the OCaml interfaces of
daemon actions. Only the Lvm and Mount modules are left with
hand-written interfaces.
[1] https://www.redhat.com/archives/libguestfs/2018-April/msg00059.html
Thanks,
Pino Toscano (3):
daemon: directly use Optgroups
daemon: use the structs from the
2020 Mar 30
0
[PATCH 1/7] New APIs: cryptsetup-open and cryptsetup-close.
...| Int64 n -> pr "caml_copy_int64 (%s)" n
- | String ((PlainString|Device|Pathname|Dev_or_Path), n) ->
+ | String ((PlainString|Device|Pathname|Dev_or_Path|Key), n) ->
pr "caml_copy_string (%s)" n
| String ((Mountable|Mountable_or_Path), n) ->
pr "guestfs_int_daemon_copy_mountable (%s)" n
diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml
index d8e7e1282..30e42864f 100644
--- a/generator/proc_nr.ml
+++ b/generator/proc_nr.ml
@@ -514,6 +514,8 @@ let proc_nr = [
505, "f2fs_expand";
506,...
2020 Sep 07
0
[PATCH v2 1/7] New APIs: cryptsetup-open and cryptsetup-close.
...| Int64 n -> pr "caml_copy_int64 (%s)" n
- | String ((PlainString|Device|Pathname|Dev_or_Path), n) ->
+ | String ((PlainString|Device|Pathname|Dev_or_Path|Key), n) ->
pr "caml_copy_string (%s)" n
| String ((Mountable|Mountable_or_Path), n) ->
pr "guestfs_int_daemon_copy_mountable (%s)" n
diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml
index d8e7e1282..30e42864f 100644
--- a/generator/proc_nr.ml
+++ b/generator/proc_nr.ml
@@ -514,6 +514,8 @@ let proc_nr = [
505, "f2fs_expand";
506,...