Displaying 20 results from an estimated 98 matches for "is_regular_fil".
Did you mean:
is_regular_file
2019 Jul 04
3
[PATCH] v2v: Allow Windows virtio ISO to be a block device as well as a regular file.
...ertion(+), 1 deletion(-)
diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml
index 59b0bf493..56c7a6757 100644
--- a/v2v/windows_virtio.ml
+++ b/v2v/windows_virtio.ml
@@ -338,7 +338,7 @@ and copy_from_virtio_win g inspect srcdir destdir filter missing =
) paths
)
)
- else if is_regular_file virtio_win then (
+ else if is_regular_file virtio_win || is_block_device virtio_win then (
debug "windows: copy_from_virtio_win: guest tools source ISO %s" virtio_win;
try
--
2.22.0
2015 Aug 10
0
[PATCH 3/4] v2v: copy virtio drivers without guestfs handle leak
...(Filename.basename path)) in
+ if verbose () then
+ printf "Copying virtio driver bits: 'host:%s' -> '%s'\n"
+ source target;
+
+ g#write target (read_whole_file source)
+ )
+ ) paths
+ )
+ else if is_regular_file virtio_win then (
+ try
+ let g2 = new Guestfs.guestfs () in
+ if trace () then g2#set_trace true;
+ if verbose () then g2#set_verbose true;
+ g2#add_drive_opts virtio_win ~readonly:true;
+ g2#launch ();
+ let vio_root = "/" in
+ g2#m...
2015 Oct 21
1
[PATCH] v2v: fix identifier
...b.
---
v2v/convert_windows.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
index 099ced2..fbd3ce1 100644
--- a/v2v/convert_windows.ml
+++ b/v2v/convert_windows.ml
@@ -296,7 +296,7 @@ echo uninstalling Xen PV driver
else if is_regular_file virtio_win then (
try
let g2 = open_guestfs () in
- g#set_identifier "virtio_win";
+ g2#set_identifier "virtio_win";
g2#add_drive_opts virtio_win ~readonly:true;
g2#launch ();
let vio_root = "/" in
--
2.1.0
2015 Oct 13
2
[PATCH v2 2/4] v2v: copy virtio drivers without guestfs handle leak
...(Filename.basename path)) in
+ if verbose () then
+ printf "Copying virtio driver bits: 'host:%s' -> '%s'\n"
+ source target;
+
+ g#write target (read_whole_file source)
+ )
+ ) paths
+ )
+ else if is_regular_file virtio_win then (
+ try
+ let g2 = new Guestfs.guestfs () in
+ if trace () then g2#set_trace true;
+ if verbose () then g2#set_verbose true;
+ g2#add_drive_opts virtio_win ~readonly:true;
+ g2#launch ();
+ let vio_root = "/" in
+ g2#m...
2015 Aug 10
15
[PATCH 0/4] v2v: simplify driver copying from virtio-win iso
Libguestfs supports passing an ISO image as a source of virtio windows
drivers to v2v.
That support, however, looks too heavy-weight: in order to access those
drivers, a separate guestfs handle is created (and thus a new emulator
process is started), which runs until v2v completes.
This series attempts to make it simpler and lighter-weight, by making
the relevant code more local, and by
2016 Mar 03
1
[PATCH] mllib: factor out mounting of guest root
...nspect_mount_root_ro g root;
let files =
let typ = g#inspect_get_type root in
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 6bf99cd..de83dd7 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -833,3 +833,21 @@ let read_first_line_from_file filename =
let is_regular_file path = (* NB: follows symlinks. *)
try (Unix.stat path).Unix.st_kind = Unix.S_REG
with Unix.Unix_error _ -> false
+
+let inspect_mount_root g ?mount_opts_fn root =
+ let mps = g#inspect_get_mountpoints root in
+ let cmp (a,_) (b,_) =
+ compare (String.length a) (String.length b) in
+...
2015 Oct 14
5
[PATCH v3 0/3] v2v: simplify driver copying from virtio-win iso
Libguestfs supports passing an ISO image as a source of virtio windows
drivers to v2v.
This series attempts to make it simpler and better scoped.
Roman Kagan (3):
v2v: consolidate virtio-win file copying
v2v: copy virtio drivers without guestfs handle leak
v2v: drop useless forced gc
---
changes since v2:
- drop patch 4 (reuse of the master guestfs handle for hot-adding the
ISO image)
2018 Nov 07
1
Re: [PATCH v3 1/3] v2v: refactor copy_drivers() in Windows_virtio
...g#write target (read_whole_file source);
> - ret := true
> + List.push_front target_name ret
This will return the list of files backwards (if that matters), but is
also more efficient than using push_back.
> )
> ) paths
> )
> else if is_regular_file virtio_win then (
> - debug "windows: copy_drivers: source ISO virtio_win %s" virtio_win;
> + debug "windows: copy_from_virtio_win: guest tools source ISO %s" virtio_win;
>
> try
> let g2 = open_guestfs ~identifier:"virtio_win" () in...
2015 Oct 21
2
[PATCH] v2v: use open_guestfs everywhere
...| 4 ++--
10 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
index 6402a63..099ced2 100644
--- a/v2v/convert_windows.ml
+++ b/v2v/convert_windows.ml
@@ -295,10 +295,8 @@ echo uninstalling Xen PV driver
)
else if is_regular_file virtio_win then (
try
- let g2 = new Guestfs.guestfs () in
+ let g2 = open_guestfs () in
g#set_identifier "virtio_win";
- if trace () then g2#set_trace true;
- if verbose () then g2#set_verbose true;
g2#add_drive_opts virtio_win ~reado...
2018 Nov 07
0
[PATCH v3 1/3] v2v: refactor copy_drivers() in Windows_virtio
...e in
+ debug "windows: copying guest tools bits: 'host:%s' -> '%s'"
source target;
g#write target (read_whole_file source);
- ret := true
+ List.push_front target_name ret
)
) paths
)
else if is_regular_file virtio_win then (
- debug "windows: copy_drivers: source ISO virtio_win %s" virtio_win;
+ debug "windows: copy_from_virtio_win: guest tools source ISO %s" virtio_win;
try
let g2 = open_guestfs ~identifier:"virtio_win" () in
@@ -283,19 +296,20 @@ an...
2018 Nov 13
0
[PATCH v4 1/3] v2v: refactor copy_drivers() in Windows_virtio
...e in
+ debug "windows: copying guest tools bits: 'host:%s' -> '%s'"
source target;
g#write target (read_whole_file source);
- ret := true
+ List.push_front target_name ret
)
) paths
)
else if is_regular_file virtio_win then (
- debug "windows: copy_drivers: source ISO virtio_win %s" virtio_win;
+ debug "windows: copy_from_virtio_win: guest tools source ISO %s" virtio_win;
try
let g2 = open_guestfs ~identifier:"virtio_win" () in
@@ -283,19 +296,20 @@ an...
2018 Nov 06
0
[PATCH 1/3] v2v: refactor copy_drivers() in Windows_virtio
...target_name in
+ debug "copying guest tool bits: 'host:%s' -> '%s'"
source target;
g#write target (read_whole_file source);
- ret := true
+ List.push_front target_name ret
)
) paths
)
else if is_regular_file virtio_win then (
- debug "windows: copy_drivers: source ISO virtio_win %s" virtio_win;
+ debug "copy_files: guest tools source ISO %s" virtio_win;
try
let g2 = open_guestfs ~identifier:"virtio_win" () in
@@ -283,19 +286,20 @@ and copy_drivers g in...
2015 Nov 10
0
[PATCH 4/4] mllib, v2v: Allow open_guestfs to set the handle identifier.
...tch conversion_mode with
| Copying (overlays, _) -> populate_overlays g overlays
diff --git a/v2v/windows.ml b/v2v/windows.ml
index d3bc5d9..b7447a5 100644
--- a/v2v/windows.ml
+++ b/v2v/windows.ml
@@ -72,8 +72,7 @@ let rec copy_virtio_drivers g inspect virtio_win driverdir =
)
else if is_regular_file virtio_win then (
try
- let g2 = open_guestfs () in
- g2#set_identifier "virtio_win";
+ let g2 = open_guestfs ~identifier:"virtio_win" () in
g2#add_drive_opts virtio_win ~readonly:true;
g2#launch ();
let vio_root = "/" in
--
2...
2015 Jun 23
0
[PATCH v2] v2v: Support loading virtio-win drivers from virtio-win.iso (RHBZ#1234351).
...d.vwd_os_variant with
+ | Vwd_client -> "client" | Vwd_server -> "server"
+ | Vwd_any_variant -> "any")
+ vwd.vwd_os_arch
+ vwd.vwd_extension
+ vwd.vwd_original_source
+
+let find_virtio_win_drivers virtio_win =
+ let is_regular_file path = (* NB: follows symlinks. *)
+ try (Unix.stat path).Unix.st_kind = Unix.S_REG
+ with Unix.Unix_error _ -> false
+ in
+
+ let files =
+ if is_directory virtio_win then (
+ let cmd = sprintf "cd %s && find -type f" (quote virtio_win) in
+ let paths = e...
2018 May 18
2
[PATCH] RFC: v2v: use RHV Setup Tools ISO if available
...he guest is automatically updated with new drivers etc. You may wish to install RHEV-APT manually after conversion.")
- tool_path
+ let rhev_apt =
+ let iso = virt_tools_data_dir () // "rhv-guest-tools-iso" // "rhv-tools-setup.iso" in
+ if is_regular_file iso then
+ ISO (iso, "/RHEV-Application Provisioning Tool.exe")
+ else
+ Local_path (virt_tools_data_dir () // "rhev-apt.exe") in
+
+ if copy_rhev_apt rhev_apt then
+ configure_rhev_apt ()
);
(* Install VMDP unconditionally, if a...
2015 Jun 23
2
[PATCH v2] v2v: Support loading virtio-win drivers from
In version 2:
- Add a bunch of debugging output.
- Recognize Windows Vista, Windows 10.
- Compare driver paths case-insensitively.
2019 Dec 12
5
[PATCH 0/4] Various small build fixes
*** BLURB HERE? ***
Pino Toscano (4):
build: stop shipping files generated by configure
docs: fix out-of-source documentation build
generator: do not generate mlv2v files when not needed
perl: fix path to Build.PL
docs/Makefile.am | 4 ++--
generator/main.ml | 11 +++++++----
perl/Makefile.am | 2 +-
python/Makefile.am | 3 ++-
tests/daemon/Makefile.am |
2015 Jun 22
2
[PATCH] v2v: Support loading virtio-win drivers from virtio-win.iso (RHBZ#1234351).
...wd_os_arch : string; (* Architecture, eg "i386", "x86_64". *)
+ vwd_extension : string; (* File extension, eg. "sys", "inf" *)
+}
+and vwd_os_variant = Vwd_client | Vwd_server | Vwd_any_variant
+
+let find_virtio_win_drivers virtio_win =
+ let is_regular_file path = (* NB: follows symlinks. *)
+ try (Unix.stat path).Unix.st_kind = Unix.S_REG
+ with Unix.Unix_error _ -> false
+ in
+
+ let files =
+ if is_directory virtio_win then (
+ let cmd = sprintf "cd %s && find -type f" (quote virtio_win) in
+ let paths = e...
2017 Jul 14
0
[PATCH 12/27] daemon: Reimplement ‘file_architecture’ API in OCaml.
...rbose () then eprintf "%s\n%!" cmd;
+ if Sys.command cmd <> 0 then
+ failwith "cpio command failed";
+
+ (* See if any of the binaries were present in the output. *)
+ let rec loop = function
+ | bin :: bins ->
+ let bin_path = tmpdir // bin in
+ if is_regular_file bin_path then (
+ let out = command "file" ["-zb"; bin_path] in
+ file_architecture_of_magic out orig_path bin_path
+ )
+ else
+ loop bins
+ | [] ->
+ failwithf "could not determine architecture of cpio archive: %s" path...
2017 Sep 12
0
[PATCH v8 1/7] ocaml osinfo database iterator
...ead_osinfo_db_directory fn path
+
+and read_osinfo_db_directory fn path =
+ let entries = Array.to_list (Sys.readdir path) in
+ let entries = List.filter (fun x -> Filename.check_suffix x ".xml") entries in
+ let entries = List.map ((//) path) entries in
+ let entries = List.filter is_regular_file entries in
+ List.iter fn entries
+
diff --git a/builder/osinfo.mli b/builder/osinfo.mli
new file mode 100644
index 000000000..949d776a9
--- /dev/null
+++ b/builder/osinfo.mli
@@ -0,0 +1,22 @@
+(* virt-builder
+ * Copyright (C) 2017 Red Hat Inc.
+ *
+ * This program is free software; you can redi...