search for: is_partition

Displaying 20 results from an estimated 28 matches for "is_partition".

2014 Dec 09
0
[PATCH] inspection: Not an installer if there are multiple partitions (RHBZ#1171666).
...void guestfs___free_inspect_info (guestfs_h *g); extern char *guestfs___download_to_tmp (guestfs_h *g, struct inspect_fs *fs, const char *filename, const char *basename, uint64_t max_size); extern struct inspect_fs *guestfs___search_for_root (guestfs_h *g, const char *root); +extern int guestfs___is_partition (guestfs_h *g, const char *partition); /* inspect-fs.c */ extern int guestfs___is_file_nocase (guestfs_h *g, const char *); diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index 750c27b..5ba8beb 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -96,7 +96,6 @@ static c...
2019 Jan 14
1
[PATCH] inspect: fix inspection of partition-less devices (RHBZ#1661038)
...-th partition on that disk. @@ -504,7 +504,7 @@ and resolve_xdev typ disk part default = let i = drive_index disk in if i >= 0 && i < Array.length devices then ( let dev = Array.get devices i in - let dev = dev ^ string_of_int part in + let dev = dev ^ part in if is_partition dev then Mountable.of_device dev else -- 2.20.1
2016 Jun 02
3
[PATCH 0/3] builder: Warn if --output is a host partition.
Rather complex patch to solve a small user error. Warn if the user is doing something like: virt-builder -o /dev/sdX1 Rich.
2013 Jan 25
4
[PATCH 0/3] Use __attribute__((cleanup(...)))
This patch series changes a small part of the library to use __attribute__((cleanup(...))) to automatically free memory when pointers go out of the current scope. In general terms this seems to be a small win although you do have to use it carefully. For functions where you can completely get rid of the "exit code paths", it can simplify things. For a good example, see the
2016 Jun 14
1
[PATCH] mllib: Use Unix.F_OK instead of plain F_OK.
...l not be selected if the type becomes unknown. --- mllib/common_utils.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 8e9f943..64bf3d3 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -823,7 +823,7 @@ let is_partition dev = let major = Dev_t.major rdev in let minor = Dev_t.minor rdev in let path = sprintf "/sys/dev/block/%d:%d/partition" major minor in - Unix.access path [F_OK]; + Unix.access path [Unix.F_OK]; true ) with Unix.Unix_error _ -> false -- 2...
2014 Dec 03
0
[PATCH 2/4] Support fstab block device resolution for NetBSD
...Hash_table *md_map); + Hash_table *md_map, + enum inspect_os_type os_type); static int inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs, const char **configfiles, int (*f) (guestfs_h *, struct inspect_fs *)); static int is_partition (guestfs_h *g, const char *partition); @@ -1049,7 +1051,7 @@ check_fstab (guestfs_h *g, struct inspect_fs *fs) mountable = safe_strdup (g, fs->mountable); else if (STRPREFIX (spec, "/dev/")) /* Resolve guest block device names. */ - mountable = resolve_fstab_d...
2014 Dec 02
0
[PATCH 3/5] Support fstab block device resolution for NetBSD
...Hash_table *md_map); + Hash_table *md_map, + enum inspect_os_type os_type); static int inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs, const char **configfiles, int (*f) (guestfs_h *, struct inspect_fs *)); static int is_partition (guestfs_h *g, const char *partition); @@ -1045,7 +1047,7 @@ check_fstab (guestfs_h *g, struct inspect_fs *fs) /* Ignore "/.swap" (Pardus) and pseudo-devices like "tmpfs". */ else if (STRPREFIX (spec, "/dev/")) /* Resolve guest block device names....
2020 Feb 20
1
[PATCH] lib: Move guestfs_device_index impl from daemon to library.
Although the commit message ties this to https://bugzilla.redhat.com/1804207, in fact I believe this commit could be applied independently. It's a simple optimization. Rich.
2017 Aug 09
0
[PATCH v12 08/11] daemon: Implement inspection types and utility functions.
...+ try Some (Realpath.case_sensitive_path path) + with _ -> None in + match path with + | None -> false + | Some path -> Is.is_dir path + +(* Rather hairy test for "is a partition", taken directly from + * the old C inspection code. XXX fix function and callers + *) +let is_partition partition = + try + let device = Devsparts.part_to_dev partition in + ignore (Devsparts.device_index device); + true + with _ -> false + +let re_major_minor = PCRE.compile "(\\d+)\\.(\\d+)" +let re_major_no_minor = PCRE.compile "(\\d+)" + +let parse_version_from_ma...
2012 Nov 14
1
Notes on compiling libguestfs 1.19.59 on Debian 7 (Wheezy) beta
In no particular order. Some of these need further investigation. ---------------------------------------------------------------------- I had to patch libguestfs not to use febootstrap-supermin-helper --copy-kernel option. See attachment #1. This could be avoided by providing a newer febootstrap in Wheezy. I had to patch libguestfs to make it not use the (not working) virtio-scsi in old
2017 Nov 05
3
[PATCH 1/2] common/mlstdutils: Add with_open_in and with_open_out functions.
...`Zip + else if get 0 4 = Some "PK\007\008" then `Zip + else if get 257 6 = Some "ustar\000" then `Tar + else if get 257 8 = Some "ustar\x20\x20\000" then `Tar + else if get 0 2 = Some "\x1f\x8b" then `GZip + else `Unknown + ) let is_partition dev = try diff --git a/dib/dib.ml b/dib/dib.ml index 9a8d86bd9..94ad3003a 100644 --- a/dib/dib.ml +++ b/dib/dib.ml @@ -60,10 +60,11 @@ let read_dib_envvars () = String.concat "" vars let write_script fn text = - let oc = open_out fn in - output_string oc text; - flush oc; - c...
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...<stdlib>*) + let is_block_device file = try (Unix.stat file).Unix.st_kind = Unix.S_BLK with Unix.Unix_error _ -> false @@ -913,6 +1009,8 @@ let is_char_device file = try (Unix.stat file).Unix.st_kind = Unix.S_CHR with Unix.Unix_error _ -> false +(*</stdlib>*) + let is_partition dev = try if not (is_block_device dev) then false @@ -926,6 +1024,8 @@ let is_partition dev = ) with Unix.Unix_error _ -> false +(*<stdlib>*) + (* Annoyingly Sys.is_directory throws an exception on failure * (RHBZ#1022431). *) @@ -995,6 +1095,8 @@ let is_regular_file...
2017 Aug 09
0
[PATCH v12 09/11] daemon: Implement inspection of Linux and other Unix-like operating systems.
...39;s a good idea in general. + *) + + (* Guess the appliance device name if we didn't find a matching hint. *) + let i = drive_index disk in + if i >= 0 && i < Array.length devices then ( + let dev = Array.get devices i in + let dev = dev ^ string_of_int part in + if is_partition dev then + Mountable.of_device dev + else + default + ) + else + default + +(* disk: (cciss/c\d+d\d+) + * part: (\d+)? + *) +and resolve_cciss disk part default = + (* XXX Check any hints we were passed for a non-heuristic mapping. + * The C code used hints here to map device n...
2017 Jul 31
0
[PATCH v11 08/10] daemon: Implement inspection of Linux and other Unix-like operating systems.
...39;s a good idea in general. + *) + + (* Guess the appliance device name if we didn't find a matching hint. *) + let i = drive_index disk in + if i >= 0 && i < Array.length devices then ( + let dev = Array.get devices i in + let dev = dev ^ string_of_int part in + if is_partition dev then + Mountable.of_device dev + else + default + ) + else + default + +(* disk: (cciss/c\d+d\d+) + * part: (\d+)? + *) +and resolve_cciss disk part default = + (* XXX Check any hints we were passed for a non-heuristic mapping. + * The C code used hints here to map device n...
2012 Oct 08
5
[PATCH v4 0/5] Finish hotplugging support.
This rounds off hotplugging support by allowing you to add and remove drives at any stage (before and after launch). Rich.
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
...chan; ret -(*<stdlib>*) - -let is_block_device file = - try (Unix.stat file).Unix.st_kind = Unix.S_BLK - with Unix.Unix_error _ -> false - -let is_char_device file = - try (Unix.stat file).Unix.st_kind = Unix.S_CHR - with Unix.Unix_error _ -> false - -(*</stdlib>*) - let is_partition dev = try if not (is_block_device dev) then false @@ -1075,87 +482,6 @@ let is_partition dev = ) with Unix.Unix_error _ -> false -(*<stdlib>*) - -(* Annoyingly Sys.is_directory throws an exception on failure - * (RHBZ#1022431). - *) -let is_directory path = - try Sys.is_...
2017 Feb 22
4
[PATCH 0/3] v2v: vCenter: Remove proxy environment variables
Fix for: https://bugzilla.redhat.com/show_bug.cgi?id=1354507 Main explanation is in patch #3. Rich.
2012 Aug 29
5
[PATCH 0/4] Add hivex APIs into the libguestfs API (RHBZ#852394)
This adds most of the hivex APIs directly to the libguestfs API, so that you can read and write Windows Registry hive files from libguestfs without needing to download and upload hive files from the guest. This is analogous to how Augeas APIs are exposed already (guestfs_aug_*) Also, inspection is now done using the new APIs, which fixes the following bug:
2017 Jul 21
10
[PATCH v10 00/10] Reimplement inspection in the daemon.
v9 was here: https://www.redhat.com/archives/libguestfs/2017-July/msg00139.html This depends on these three series (the first two being single minor patches): https://www.redhat.com/archives/libguestfs/2017-July/msg00207.html https://www.redhat.com/archives/libguestfs/2017-July/msg00209.html https://www.redhat.com/archives/libguestfs/2017-July/msg00215.html There is no substantive change. I
2017 Jul 17
12
[PATCH v9 00/11] Reimplement inspection in the daemon.
This depends on the patch series "[PATCH 00/27] Reimplement many daemon APIs in OCaml." (https://www.redhat.com/archives/libguestfs/2017-July/msg00098.html) v8 was posted here: https://www.redhat.com/archives/libguestfs/2017-June/msg00274.html v9: - I split up the mega-patch into a more reviewable series of smaller, incremental patches. There are some other changes vs v8, but