[Libguestfs] [PATCH] v2v: fix directory check for virtio-win as directory
Richard W.M. Jones
rjones at redhat.com
Wed Mar 20 22:26:44 UTC 2019
On Wed, Mar 20, 2019 at 07:08:45PM +0100, Pino Toscano wrote:
> When trying to install files from virtio-win as directory, check for
> directory existance using absolute paths. Otherwise, is_directory is
> called on relative paths such as "linux/el7" which obviously do not
> exist.
>
> Fixes commit 1c85b64c1c3a4d5267b952102375cb78f18a85c4.
> ---
> v2v/windows_virtio.ml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml
> index 92bf3ec60..3a3559cb2 100644
> --- a/v2v/windows_virtio.ml
> +++ b/v2v/windows_virtio.ml
> @@ -311,7 +311,7 @@ and copy_from_virtio_win g inspect srcdir destdir filter missing =
> let dir = virtio_win // srcdir in
> debug "windows: copy_from_virtio_win: guest tools source directory %s" dir;
>
> - if not (is_directory srcdir) then missing ()
> + if not (is_directory dir) then missing ()
> else (
> let cmd = sprintf "cd %s && find -L -type f" (quote dir) in
> let paths = external_command cmd in
I think Tomas suggested something like this before:
https://www.redhat.com/archives/libguestfs/2019-January/msg00218.html
but yes ACK.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
More information about the Libguestfs
mailing list