Pino Toscano
2019-Mar-20 18:08 UTC
[Libguestfs] [PATCH] v2v: fix directory check for virtio-win as directory
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 -- 2.20.1
Richard W.M. Jones
2019-Mar-20 22:26 UTC
Re: [Libguestfs] [PATCH] v2v: fix directory check for virtio-win as directory
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 inI 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/
Pino Toscano
2019-Mar-21 11:01 UTC
Re: [Libguestfs] [PATCH] v2v: fix directory check for virtio-win as directory
On Wednesday, 20 March 2019 23:26:44 CET Richard W.M. Jones wrote:> 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.htmlIndeed, let's go with his patch then (not sure why it was not committed yet). -- Pino Toscano
Seemingly Similar Threads
- Re: [PATCH 1/2] v2v: fix path to source when copying files from guest tools directory
- Re: [PATCH] v2v: fix directory check for virtio-win as directory
- Re: [PATCH v3 1/3] v2v: refactor copy_drivers() in Windows_virtio
- [PATCH 0/2] allow alternative guest tools directories for distributions
- [PATCH v3] v2v: don't fail when virtio-win does not have qemu-ga