Roman Kagan
2016-Jun-03 17:23 UTC
[Libguestfs] [PATCH] v2v: copy all driver files into guest
Some virtio-win drivers contain more files than just *.{cat,inf,sys}. They are filtered out currently, which prevents the drivers from being installed by PnP. Stop filtering driver files by extension, and copy all of them instead. Signed-off-by: Roman Kagan <rkagan at virtuozzo.com> --- v2v/windows_virtio.ml | 11 ----------- 1 file changed, 11 deletions(-) diff --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"; "sys"] in - if not (List.mem extension extensions) then raise Not_found; (* Using the full path, work out what version of Windows * this driver is for. Paths can be things like: -- 2.5.5
Richard W.M. Jones
2016-Jun-03 21:36 UTC
[Libguestfs] [PATCH] v2v: copy all driver files into guest
On Fri, Jun 03, 2016 at 08:23:01PM +0300, Roman Kagan wrote:> Some virtio-win drivers contain more files than just *.{cat,inf,sys}. > They are filtered out currently, which prevents the drivers from being > installed by PnP. > > Stop filtering driver files by extension, and copy all of them instead. > > Signed-off-by: Roman Kagan <rkagan at virtuozzo.com> > --- > v2v/windows_virtio.ml | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --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"; "sys"] in > - if not (List.mem extension extensions) then raise Not_found; > > (* Using the full path, work out what version of Windows > * this driver is for. Paths can be things like:At a guess this will break the test suite. I can't check right now because I'm running another test on my laptop, but will try it later. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Richard W.M. Jones
2016-Jun-03 21:46 UTC
Re: [Libguestfs] [PATCH] v2v: copy all driver files into guest
On Fri, Jun 03, 2016 at 10:36:52PM +0100, Richard W.M. Jones wrote:> On Fri, Jun 03, 2016 at 08:23:01PM +0300, Roman Kagan wrote: > > Some virtio-win drivers contain more files than just *.{cat,inf,sys}. > > They are filtered out currently, which prevents the drivers from being > > installed by PnP. > > > > Stop filtering driver files by extension, and copy all of them instead. > > > > Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> > > --- > > v2v/windows_virtio.ml | 11 ----------- > > 1 file changed, 11 deletions(-) > > > > diff --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"; "sys"] in > > - if not (List.mem extension extensions) then raise Not_found; > > > > (* Using the full path, work out what version of Windows > > * this driver is for. Paths can be things like: > > At a guess this will break the test suite. I can't check right now > because I'm running another test on my laptop, but will try it later.Yes, this breaks v2v_unit_tests. In this particular case because WdfCoInstaller01011.dll is being copied in. I had a patch a while back which copied this file: https://www.redhat.com/archives/libguestfs/2016-March/msg00037.html It didn't go upstream, but I don't recall why .. There could be other errors. The test only reports and stops at the first one. 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/
Apparently Analagous Threads
- Re: [PATCH] v2v: copy all driver files into guest
- [PATCH v2 0/2] v2v: Copy *.dll files since they can be part of the driver (RHBZ#1311373).
- [PATCH v3 0/2] v2v: Copy *.dll files since they can be part of the
- [PATCH 0/4] v2v: simplify driver copying from virtio-win iso
- [PATCH v3 0/3] v2v: simplify driver copying from virtio-win iso