Displaying 20 results from an estimated 26 matches for "mountablepath".
2018 Apr 09
2
[PATCH] daemon: Fix type signature of mount_vfs (RHBZ#1564983).
https://bugzilla.redhat.com/show_bug.cgi?id=1564983
Because Mount.mount_vfs was declared with the wrong type signature it
could never be called correctly from outside the daemon.
The root cause of this problem is that the generator doesn't generate
the type signatures automatically (which it could do, and fairly
easily). Therefore there are probably other similar bugs waiting to
be found.
2017 Jul 14
0
[PATCH 04/27] daemon: Reimplement ‘vfs_type’ API in OCaml.
...ral Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *)
+
+open Printf
+
+type t = {
+ m_type : mountable_type;
+ m_device : string;
+}
+and mountable_type =
+ | MountableDevice
+ | MountablePath
+ | MountableBtrfsVol of string (* volume *)
+
+let to_string { m_type = t; m_device = device } =
+ match t with
+ | MountableDevice | MountablePath -> device
+ | MountableBtrfsVol volume ->
+ sprintf "btrfsvol:%s/%s" device volume
+
+let of_device device =
+ { m_type = Mou...
2017 Jul 14
0
[PATCH 09/27] daemon: Reimplement ‘mount’, ‘mount_ro’, ‘mount_options’, ‘mount_vfs’ APIs in OCaml.
...he mountpoint exists and is a directory. *)
+ if not (is_directory mp) then
+ failwithf "mount: %s: mount point is not a directory" mountpoint;
+
+ let args = ref [] in
+
+ (* -o options *)
+ (match options, mountable.m_type with
+ | (None | Some ""), (MountableDevice | MountablePath) -> ()
+ | Some options, (MountableDevice | MountablePath) ->
+ push_back args "-o";
+ push_back args options
+ | (None | Some ""), MountableBtrfsVol subvol ->
+ push_back args "-o";
+ push_back args ("subvol=" ^ subvol)
+ |...
2017 Jul 21
0
[PATCH v2 15/23] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
...the filesystem. But we cannot
+ * mount it under the sysroot, 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 tmpd...
[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.
...up function which is called to unmount and
+ * remove the 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 ~fi...
2017 Jun 03
12
[PATCH v2 00/12] Allow APIs to be implemented in OCaml.
Version 1 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00003.html
This patch series reimplements a few more APIs in OCaml, including
some very important core APIs like ?list_filesystems? and ?mount?.
All the tests pass after this.
The selection of APIs that I have moved may look a little random, but
in fact they are all APIs consumed by the inspection code (and some
more
2017 Jun 05
19
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
v2 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00008.html
This series gets as far as a working (and faster) reimplementation of
‘guestfs_list_filesystems’.
I also have another patch series on top of this one which reimplements
the inspection APIs inside the daemon, but that needs a bit more work
still, since inspection turns out to be a very large piece of code.
Rich.
2017 Jul 21
27
[PATCH v2 00/23] Reimplement many daemon APIs in OCaml.
v1 was posted here:
https://www.redhat.com/archives/libguestfs/2017-July/msg00098.html
This series now depends on two small patches which I posted separately:
https://www.redhat.com/archives/libguestfs/2017-July/msg00207.html
https://www.redhat.com/archives/libguestfs/2017-July/msg00209.html
v1 -> v2:
- Previously changes to generator/daemon.ml were made incrementally
through the patch
2017 Jul 27
23
[PATCH v3 00/23] Reimplement many daemon APIs in OCaml.
I think this fixes everything mentioned:
- Added the Optgroups module as suggested.
- Remove command temporary files.
- Replace command ~flags with ?fold_stdout_on_stderr.
- Nest _with_mounted function.
- Rebase & retest.
Rich.
2017 Jul 21
0
[PATCH v2 01/23] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...tfs_int_daemon_copy_mountable (const mountable_t *mountable)
+{
+ CAMLparam0 ();
+ CAMLlocal4 (r, typev, devicev, volumev);
+
+ switch (mountable->type) {
+ case MOUNTABLE_DEVICE:
+ typev = Val_int (0); /* MountableDevice */
+ break;
+ case MOUNTABLE_PATH:
+ typev = Val_int (1); /* MountablePath */
+ break;
+ case MOUNTABLE_BTRFSVOL:
+ volumev = caml_copy_string (mountable->volume);
+ typev = caml_alloc (1, 0); /* MountableBtrfsVol */
+ Store_field (typev, 0, volumev);
+ }
+
+ devicev = caml_copy_string (mountable->device);
+
+ r = caml_alloc_tuple (2);
+ Store_field...
2017 Jul 14
0
[PATCH 19/27] daemon: Reimplement ‘list_filesystems’ API in the daemon, in OCaml.
...ringsbuf (&ret); /* caller frees */
}
+/* Implement RString (RMountable, _). */
+static char *
+return_string_mountable (value retv)
+{
+ value typev = Field (retv, 0);
+ value devicev = Field (retv, 1);
+ value subvolv;
+ char *ret;
+
+ if (Is_long (typev)) { /* MountableDevice or MountablePath */
+ ret = strdup (String_val (devicev));
+ if (ret == NULL)
+ reply_with_perror (\"strdup\");
+ return ret;
+ }
+ else { /* MountableBtrfsVol of subvol */
+ subvolv = Field (typev, 0);
+ if (asprintf (&ret, \"btrfsvol:%%s/%%s\",
+...
2017 Jul 14
45
[PATCH 00/27] Reimplement many daemon APIs in OCaml.
Previously posted as part of the mega utilities/inspection
series here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00232.html
What I've done is to extract just the parts related to rewriting
daemon APIs in OCaml, rebase them on top of the current master, fix a
few things, and recompile and test everything.
Rich.
2017 Aug 09
0
[PATCH v12 09/11] daemon: Implement inspection of Linux and other Unix-like operating systems.
...SD systems, sometimes [/dev/sda[1234]] is a shadow of the
+ * real root filesystem that is probably [/dev/sda5] (see:
+ * [http://www.freebsd.org/doc/handbook/disk-organization.html])
+ *)
+and check_for_duplicated_bsd_root fses =
+ try
+ let is_primary_partition = function
+ | { m_type = (MountablePath | MountableBtrfsVol _) } -> false
+ | { m_type = MountableDevice; m_device = d } ->
+ PCRE.matches re_primary_partition d
+ in
+
+ (* Try to find a "BSD primary", if there is one. *)
+ let bsd_primary =
+ List.find (
+ function
+ | { fs_locat...
2017 Jul 31
0
[PATCH v11 08/10] daemon: Implement inspection of Linux and other Unix-like operating systems.
...SD systems, sometimes [/dev/sda[1234]] is a shadow of the
+ * real root filesystem that is probably [/dev/sda5] (see:
+ * [http://www.freebsd.org/doc/handbook/disk-organization.html])
+ *)
+and check_for_duplicated_bsd_root fses =
+ try
+ let is_primary_partition = function
+ | { m_type = (MountablePath | MountableBtrfsVol _) } -> false
+ | { m_type = MountableDevice; m_device = d } ->
+ Str.string_match re_primary_partition d 0
+ in
+
+ (* Try to find a "BSD primary", if there is one. *)
+ let bsd_primary =
+ List.find (
+ function
+ | { fs...
2017 Nov 21
2
[PATCH v3 0/2] common/mlstdutils: Extend the List module.
v2 -> v3:
- Renamed List.assoc_ -> List.assoc_lbl.
- Rebased on top of current master branch.
Rich.
2017 Oct 08
4
[PATCH 0/3] common/mlstdutils: Add Std_utils List and Option modules.
In Std_utils we already extend Char and String. These commits take it
a little further by extending List and adding a new Option submodule.
All basically simple refactoring.
Rich.
2017 Oct 08
7
[[PATCH v2 0/4] common/mlstdutils: Add Std_utils List and Option modules.
This time including the first commit ...
2017 Jun 19
29
[PATCH v7 00/29] Reimplement inspection in the daemon.
v6 was posted here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html
and this requires the utilities refactoring posted here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html
Inspection is now complete[*], although not very well tested. I'm
intending to compare the output of many guests using old & new
virt-inspector to see if I can find any
2017 Jun 12
32
[PATCH v5 00/32] Refactor utilities, implement some APIs in OCaml.
This is a combination of:
https://www.redhat.com/archives/libguestfs/2017-June/msg00046.html
[PATCH 00/12] Refactor utility functions.
plus:
https://www.redhat.com/archives/libguestfs/2017-June/msg00023.html
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
with the second patches rebased on top of the utility refactoring, and
some other adjustments and extensions.
This passes
2017 Jun 15
45
[PATCH v6 00/41] Refactor utilities, reimplement inspection in the daemon.
v5:
https://www.redhat.com/archives/libguestfs/2017-June/msg00065.html
Since v5, this now implements inspection almost completely for Linux
and Windows guests.
Rich.