[Libguestfs] [PATCH 5/6] v2v:utils: ignore files w/o extension
Richard W.M. Jones
rjones at redhat.com
Mon Oct 5 13:26:36 UTC 2015
On Mon, Oct 05, 2015 at 03:40:05PM +0300, Roman Kagan wrote:
> When searching for virtio drivers, it makes no sense to fail if we
> encounter a file without extension.
>
> Ignore such files instead, just like we do for the files whose extension
> doesn't match that of a driver-related file.
>
> Signed-off-by: Roman Kagan <rkagan at virtuozzo.com>
> ---
> v2v/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 extensions. *)
> if extension <> "cat" && extension <> "inf" &&
ACK. I'll push this one soon.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
More information about the Libguestfs
mailing list