search for: lc_basename

Displaying 20 results from an estimated 22 matches for "lc_basename".

2016 Jun 03
2
[PATCH] v2v: copy all driver files into guest
...--git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml index 6c8396c..354aa19 100644 --- a/v2v/windows_virtio.ml +++ b/v2v/windows_virtio.ml @@ -291,17 +291,6 @@ and virtio_iso_path_matches_guest_os path inspect = * elements. *) let lc_path = String.lowercase_ascii path in - let lc_basename = Filename.basename lc_path in - - let extension = - match last_part_of lc_basename '.' with - | Some x -> x - | None -> raise Not_found - in - - (* Skip files without specific extensions. *) - let extensions = ["cat"; "inf"; "pdb&qu...
2015 Jul 01
0
Re: [PATCH 1/2] mllib: add and use last_part_of
.../find_virtio_win_drivers: missing '/' in %s" path in > (path, sprintf "%s:%s" virtio_win path, > basename, > fun () -> g#read_file path) > @@ -199,9 +201,11 @@ let find_virtio_win_drivers virtio_win = > let lc_basename = String.lowercase basename in > > let extension = > - let i = String.rindex lc_basename '.' in > - let len = String.length lc_basename in > - String.sub lc_basename (i+1) (len - (i+1)) in > + match last_part_of lc_b...
2015 Jul 01
4
[PATCH 1/2] mllib: add and use last_part_of
...error "v2v/find_virtio_win_drivers: missing '/' in %s" path in (path, sprintf "%s:%s" virtio_win path, basename, fun () -> g#read_file path) @@ -199,9 +201,11 @@ let find_virtio_win_drivers virtio_win = let lc_basename = String.lowercase basename in let extension = - let i = String.rindex lc_basename '.' in - let len = String.length lc_basename in - String.sub lc_basename (i+1) (len - (i+1)) in + match last_part_of lc_basename '.' with +...
2015 Jul 01
0
[PATCH 2/3] mllib: add and use last_part_of
...ename = last_part_of path '/' in (path, sprintf "%s:%s" virtio_win path, basename, fun () -> g#read_file path) @@ -198,10 +196,7 @@ let find_virtio_win_drivers virtio_win = let lc_path = String.lowercase path in let lc_basename = String.lowercase basename in - let extension = - let i = String.rindex lc_basename '.' in - let len = String.length lc_basename in - String.sub lc_basename (i+1) (len - (i+1)) in + let extension = last_part_of lc_basename '.' in...
2015 Jul 01
5
[PATCH 1/3] mllib: add an optional filter for rm_rf_only_files
This way it is possible to use rm_rf_only_files, but not removing specific files. --- mllib/common_utils.ml | 8 +++++++- mllib/common_utils.mli | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 516cff3..3737b4c 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -640,13 +640,19 @@ let rmdir_on_exit = *
2015 Aug 10
0
[PATCH 3/4] v2v: copy virtio drivers without guestfs handle leak
..., original_source, basename, get_contents) -> - try - (* Lowercased path, since the ISO may contain upper or lowercase - * path elements. XXX This won't work if paths contain non-ASCII. - *) - let lc_path = String.lowercase path in - let lc_basename = String.lowercase basename in - - let extension = - match last_part_of lc_basename '.' with - | Some x -> x - | None -> - error "v2v/find_virtio_win_drivers: missing '.' in %s" - lc_basename in -...
2015 Oct 06
0
[PATCH 3/5] mllib: Add (Char|String).(lower|upper)case_ascii functions.
...get_contents) -> try (* Lowercased path, since the ISO may contain upper or lowercase - * path elements. XXX This won't work if paths contain non-ASCII. + * path elements. *) - let lc_path = String.lowercase path in - let lc_basename = String.lowercase basename in + let lc_path = String.lowercase_ascii path in + let lc_basename = String.lowercase_ascii basename in let extension = match last_part_of lc_basename '.' with -- 2.5.0
2016 Mar 04
2
[PATCH v2 0/2] v2v: Copy *.dll files since they can be part of the driver (RHBZ#1311373).
Since v1: - Fix a bug in the calculation of lc_basename. By luck this doesn't affect anything given the contents of the current ISO. - Don't copy the WdfCoInstaller*.dll files. Rich.
2015 Oct 07
1
Re: [PATCH 3/5] mllib: Add (Char|String).(lower|upper)case_ascii functions.
...ry > (* Lowercased path, since the ISO may contain upper or lowercase > - * path elements. XXX This won't work if paths contain non-ASCII. > + * path elements. > *) > - let lc_path = String.lowercase path in > - let lc_basename = String.lowercase basename in > + let lc_path = String.lowercase_ascii path in > + let lc_basename = String.lowercase_ascii basename in > > let extension = > match last_part_of lc_basename '.' with I guess these usages of String.l...
2015 Oct 13
2
[PATCH v2 2/4] v2v: copy virtio drivers without guestfs handle leak
...let files = - filter_map ( - fun (path, original_source, basename, get_contents) -> - try - (* Lowercased path, since the ISO may contain upper or lowercase - * path elements. - *) - let lc_path = String.lowercase_ascii path in - let lc_basename = String.lowercase_ascii basename in +(* Given a path of a file relative to the root of the directory tree with + * virtio-win drivers, figure out if it's suitable for the specific Windows + * flavor. + *) +let match_vio_path_with_os path arch os_major os_minor os_variant = + try + (* Lower...
2015 Jun 23
0
[PATCH v2] v2v: Support loading virtio-win drivers from virtio-win.iso (RHBZ#1234351).
..., original_source, basename, get_contents) -> + try + (* Lowercased path, since the ISO may contain upper or lowercase + * path elements. XXX This won't work if paths contain non-ASCII. + *) + let lc_path = String.lowercase path in + let lc_basename = String.lowercase basename in + + let extension = + let i = String.rindex lc_basename '.' in + let len = String.length lc_basename in + String.sub lc_basename (i+1) (len - (i+1)) in + + (* Skip files without specific extensions. *) +...
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
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.
2015 Oct 05
0
[PATCH 5/6] v2v:utils: ignore files w/o extension
...v/utils.ml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/v2v/utils.ml b/v2v/utils.ml index e07f7a9..23d9e51 100644 --- a/v2v/utils.ml +++ b/v2v/utils.ml @@ -238,9 +238,8 @@ let find_virtio_win_drivers virtio_win = let extension = match last_part_of lc_basename '.' with | Some x -> x - | None -> - error "v2v/find_virtio_win_drivers: missing '.' in %s" - lc_basename in + | None -> raise Not_found + in (* Skip files without specific extens...
2016 Jun 03
0
Re: [PATCH] v2v: copy all driver files into guest
...dows_virtio.ml > index 6c8396c..354aa19 100644 > --- a/v2v/windows_virtio.ml > +++ b/v2v/windows_virtio.ml > @@ -291,17 +291,6 @@ and virtio_iso_path_matches_guest_os path inspect = > * elements. > *) > let lc_path = String.lowercase_ascii path in > - let lc_basename = Filename.basename lc_path in > - > - let extension = > - match last_part_of lc_basename '.' with > - | Some x -> x > - | None -> raise Not_found > - in > - > - (* Skip files without specific extensions. *) > - let extensions = [&...
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)
2016 Mar 04
2
[PATCH v3 0/2] v2v: Copy *.dll files since they can be part of the
v2 -> v3 - Don't make a special case for WdfCoInstaller* files. There is a difference of opinion about whether copying these is necessary, but it seems like it is not harmful. Rich.
2015 Oct 06
10
[PATCH 0/5] mllib: Hide bad String functions and miscellaneous refactoring.
Hide/prevent the use of bad string functions like String.lowercase. These are replaced by safe functions that won't break UTF-8 strings. Other miscellaneous refactoring. Rich.
2016 Jun 04
1
[PATCH v2] v2v: copy all driver files into guest
...--git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml index 6c8396c..354aa19 100644 --- a/v2v/windows_virtio.ml +++ b/v2v/windows_virtio.ml @@ -291,17 +291,6 @@ and virtio_iso_path_matches_guest_os path inspect = * elements. *) let lc_path = String.lowercase_ascii path in - let lc_basename = Filename.basename lc_path in - - let extension = - match last_part_of lc_basename '.' with - | Some x -> x - | None -> raise Not_found - in - - (* Skip files without specific extensions. *) - let extensions = ["cat"; "inf"; "pdb&qu...
2015 Oct 05
18
[PATCH 0/6] v2v: assorted improvements to tests for windows
This series makes several enhancements to tests for v2v conversion of Windows guests. Specifically, it - adds a number of files which imitate the stuff that is supposed to be present on the host when the actual conversion is performed, but may not be there when the tests are run. This includes certain tools and virtio drivers - fixes the test for windows conversion to actually