[PATCH] v2v: virtio-win: include *.dll too
Windows QXL drivers include also qxldd.dll which used to get filtered out and not copied over into the guest. As a result QXL driver failed to install due to a missing file. Correct that, and update the tests accordingly. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> --- v2v/fake-virtio-win/drivers/i386/Win7/qxldd.dll | 1 + v2v/test-v2v-in-place.sh | 1 + v2v/test-v2v-virtio-win-iso.sh | 1 + v2v/test-v2v-windows-conversion.sh | 1 + v2v/utils.ml | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/qxldd.dll diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/qxldd.dll b/v2v/fake-virtio-win/drivers/i386/Win7/qxldd.dll new file mode 100644 index 0000000..ff43465 --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/qxldd.dll @@ -0,0 +1 @@ +This is a fake qxldd.dll, used for testing only diff --git a/v2v/test-v2v-in-place.sh b/v2v/test-v2v-in-place.sh index f685ddb..1e9972d 100755 --- a/v2v/test-v2v-in-place.sh +++ b/v2v/test-v2v-in-place.sh @@ -108,6 +108,7 @@ for drv in netkvm qxl vioscsi viostor; do mktest "is-file \"$virtio_dir/$drv.$sfx\"" true done done +mktest "is-file \"$virtio_dir/qxldd.dll\"" true guestfish --ro -a "$img" -i < "$script" > "$response" diff -u "$expected" "$response" diff --git a/v2v/test-v2v-virtio-win-iso.sh b/v2v/test-v2v-virtio-win-iso.sh index 090025c..e4228c1 100755 --- a/v2v/test-v2v-virtio-win-iso.sh +++ b/v2v/test-v2v-virtio-win-iso.sh @@ -103,6 +103,7 @@ for drv in netkvm qxl vioscsi viostor; do mktest "is-file \"$virtio_dir/$drv.$sfx\"" true done done +mktest "is-file \"$virtio_dir/qxldd.dll\"" true guestfish --ro -a "$d/windows-sda" -i < "$script" > "$response" diff -u "$expected" "$response" diff --git a/v2v/test-v2v-windows-conversion.sh b/v2v/test-v2v-windows-conversion.sh index d086bc4..80b7096 100755 --- a/v2v/test-v2v-windows-conversion.sh +++ b/v2v/test-v2v-windows-conversion.sh @@ -97,6 +97,7 @@ for drv in netkvm qxl vioscsi viostor; do mktest "is-file \"$virtio_dir/$drv.$sfx\"" true done done +mktest "is-file \"$virtio_dir/qxldd.dll\"" true guestfish --ro -a "$d/windows-sda" -i < "$script" > "$response" diff -u "$expected" "$response" diff --git a/v2v/utils.ml b/v2v/utils.ml index 2a668ec..d65bb94 100644 --- a/v2v/utils.ml +++ b/v2v/utils.ml @@ -179,7 +179,7 @@ let virtio_iso_path_matches_guest_os path inspect = in (* Skip files without specific extensions. *) - let extensions = ["cat"; "inf"; "pdb"; "sys"] in + let extensions = ["cat"; "dll"; "inf"; "pdb"; "sys"] in if not (List.mem extension extensions) then raise Not_found; (* Using the full path, work out what version of Windows -- 2.4.3
On Mon, Oct 26, 2015 at 09:00:03PM +0300, Roman Kagan wrote:
Windows QXL drivers include also qxldd.dll which used to get filtered out and not copied over into the guest. As a result QXL driver failed to install due to a missing file.
Correct that, and update the tests accordingly.
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> --- v2v/fake-virtio-win/drivers/i386/Win7/qxldd.dll | 1 + v2v/test-v2v-in-place.sh | 1 + v2v/test-v2v-virtio-win-iso.sh | 1 + v2v/test-v2v-windows-conversion.sh | 1 + v2v/utils.ml | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/qxldd.dll
diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/qxldd.dll b/v2v/fake-virtio-win/drivers/i386/Win7/qxldd.dll new file mode 100644 index 0000000..ff43465 --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/qxldd.dll @@ -0,0 +1 @@ +This is a fake qxldd.dll, used for testing only diff --git a/v2v/test-v2v-in-place.sh b/v2v/test-v2v-in-place.sh index f685ddb..1e9972d 100755 --- a/v2v/test-v2v-in-place.sh +++ b/v2v/test-v2v-in-place.sh @@ -108,6 +108,7 @@ for drv in netkvm qxl vioscsi viostor; do mktest "is-file \"$virtio_dir/$drv.$sfx\"" true done done +mktest "is-file \"$virtio_dir/qxldd.dll\"" true
guestfish --ro -a "$img" -i < "$script" > "$response" diff -u "$expected" "$response" diff --git a/v2v/test-v2v-virtio-win-iso.sh b/v2v/test-v2v-virtio-win-iso.sh index 090025c..e4228c1 100755 --- a/v2v/test-v2v-virtio-win-iso.sh +++ b/v2v/test-v2v-virtio-win-iso.sh @@ -103,6 +103,7 @@ for drv in netkvm qxl vioscsi viostor; do mktest "is-file \"$virtio_dir/$drv.$sfx\"" true done done +mktest "is-file \"$virtio_dir/qxldd.dll\"" true
guestfish --ro -a "$d/windows-sda" -i < "$script" > "$response" diff -u "$expected" "$response" diff --git a/v2v/test-v2v-windows-conversion.sh b/v2v/test-v2v-windows-conversion.sh index d086bc4..80b7096 100755 --- a/v2v/test-v2v-windows-conversion.sh +++ b/v2v/test-v2v-windows-conversion.sh @@ -97,6 +97,7 @@ for drv in netkvm qxl vioscsi viostor; do mktest "is-file \"$virtio_dir/$drv.$sfx\"" true done done +mktest "is-file \"$virtio_dir/qxldd.dll\"" true
guestfish --ro -a "$d/windows-sda" -i < "$script" > "$response" diff -u "$expected" "$response" diff --git a/v2v/utils.ml b/v2v/utils.ml index 2a668ec..d65bb94 100644 --- a/v2v/utils.ml +++ b/v2v/utils.ml @@ -179,7 +179,7 @@ let virtio_iso_path_matches_guest_os path inspect = in
(* Skip files without specific extensions. *) - let extensions = ["cat"; "inf"; "pdb"; "sys"] in + let extensions = ["cat"; "dll"; "inf"; "pdb"; "sys"] in if not (List.mem extension extensions) then raise Not_found;
(* Using the full path, work out what version of Windows
Looks good. I'll push this later today. Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
On Mon, Oct 26, 2015 at 09:00:03PM +0300, Roman Kagan wrote:
Windows QXL drivers include also qxldd.dll which used to get filtered out and not copied over into the guest. As a result QXL driver failed to install due to a missing file. (* Skip files without specific extensions. *) - let extensions = ["cat"; "inf"; "pdb"; "sys"] in + let extensions = ["cat"; "dll"; "inf"; "pdb"; "sys"] in
Actually no, this part is (may be) wrong. This causes WdfCoInstaller*.dll from the ISO to be copied in. It's not clear to me whether these files are needed - I suspect not. It also causes the tests to fail, although only when you have installed the optional ocaml oUnit2 package: ---------------------------------------------------------------------- Error: virt-v2v:3:Utils.virtio_iso_path_matches_guest_os. File "/home/rjones/d/libguestfs/v2v/oUnit-virt-v2v-choo.home.annexia.org#01.log", line 8, characters 1-1: Error: virt-v2v:3:Utils.virtio_iso_path_matches_guest_os (in the log). Raised at file "src/oUnitAssert.ml", line 45, characters 8-27 Called from file "list.ml", line 73, characters 12-15 Called from file "list.ml", line 73, characters 12-15 Called from file "src/oUnitRunner.ml", line 46, characters 13-26 path Balloon/2k12/amd64/WdfCoInstaller01011.dll should not match win2k12_64 expected: false but got: true ---------------------------------------------------------------------- Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
On Tue, Oct 27, 2015 at 09:12:41AM +0000, Richard W.M. Jones wrote:
On Mon, Oct 26, 2015 at 09:00:03PM +0300, Roman Kagan wrote:
Windows QXL drivers include also qxldd.dll which used to get filtered out and not copied over into the guest. As a result QXL driver failed to install due to a missing file. (* Skip files without specific extensions. *) - let extensions = ["cat"; "inf"; "pdb"; "sys"] in + let extensions = ["cat"; "dll"; "inf"; "pdb"; "sys"] in
Actually no, this part is (may be) wrong.
This causes WdfCoInstaller*.dll from the ISO to be copied in. It's not clear to me whether these files are needed - I suspect not.
Yes it is, see the corresponding *.inf where it's mentioned in the corresponding CopyFiles directive (and yes, I just verified that with that file missing the balloon driver installation fails with 'file not found' error). As a matter of fact I tend to think that filtering of files by suffix is a bad idea in general: the packager of the drivers should be free to ship any files he wants, including docs and text notes. It's only the path that should match against the guest OS flavor and that really matters. E.g. the balloon driver directory also contains blnsvr.exe (and its .pdb) which is a usermode service responsible for feeding the balloon device with the memory stats; it's not a part of the driver per se but it's currently bundled with it. (I'm yet to figure out who's responsible for installing it).
It also causes the tests to fail, although only when you have installed the optional ocaml oUnit2 package:
That's a problem with the test then (and no I didn't have that package installed so my make -C v2v check passed). Roman.
On Tue, Oct 27, 2015 at 02:08:42PM +0300, Roman Kagan wrote:
On Tue, Oct 27, 2015 at 09:12:41AM +0000, Richard W.M. Jones wrote:
On Mon, Oct 26, 2015 at 09:00:03PM +0300, Roman Kagan wrote:
Windows QXL drivers include also qxldd.dll which used to get filtered out and not copied over into the guest. As a result QXL driver failed to install due to a missing file. (* Skip files without specific extensions. *) - let extensions = ["cat"; "inf"; "pdb"; "sys"] in + let extensions = ["cat"; "dll"; "inf"; "pdb"; "sys"] in
Actually no, this part is (may be) wrong.
This causes WdfCoInstaller*.dll from the ISO to be copied in. It's not clear to me whether these files are needed - I suspect not.
Yes it is, see the corresponding *.inf where it's mentioned in the corresponding CopyFiles directive (and yes, I just verified that with that file missing the balloon driver installation fails with 'file not found' error).
Maybe we should be looking at the CopyFiles directive? (As you may be able to guess, I know next to nothing about how Windows drivers work). Anyhow, can you fix up the test at least. Thanks, Rich.
As a matter of fact I tend to think that filtering of files by suffix is a bad idea in general: the packager of the drivers should be free to ship any files he wants, including docs and text notes. It's only the path that should match against the guest OS flavor and that really matters. E.g. the balloon driver directory also contains blnsvr.exe (and its .pdb) which is a usermode service responsible for feeding the balloon device with the memory stats; it's not a part of the driver per se but it's currently bundled with it. (I'm yet to figure out who's responsible for installing it).
It also causes the tests to fail, although only when you have installed the optional ocaml oUnit2 package:
That's a problem with the test then (and no I didn't have that package installed so my make -C v2v check passed).
Roman.
-- 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
On Tue, Oct 27, 2015 at 12:02:40PM +0000, Richard W.M. Jones wrote:
On Tue, Oct 27, 2015 at 02:08:42PM +0300, Roman Kagan wrote:
On Tue, Oct 27, 2015 at 09:12:41AM +0000, Richard W.M. Jones wrote:
On Mon, Oct 26, 2015 at 09:00:03PM +0300, Roman Kagan wrote:
Windows QXL drivers include also qxldd.dll which used to get filtered out and not copied over into the guest. As a result QXL driver failed to install due to a missing file. (* Skip files without specific extensions. *) - let extensions = ["cat"; "inf"; "pdb"; "sys"] in + let extensions = ["cat"; "dll"; "inf"; "pdb"; "sys"] in
Actually no, this part is (may be) wrong.
This causes WdfCoInstaller*.dll from the ISO to be copied in. It's not clear to me whether these files are needed - I suspect not.
Yes it is, see the corresponding *.inf where it's mentioned in the corresponding CopyFiles directive (and yes, I just verified that with that file missing the balloon driver installation fails with 'file not found' error).
Maybe we should be looking at the CopyFiles directive? (As you may be able to guess, I know next to nothing about how Windows drivers work).
So do I, and parsing the *.inf files is the last thing I'd like to do here; I'm not sure it can be made reliable (I mean, not the parsing, but making any sense out of the parsed data). However I'm now facing a more serious problem: when I actually went ahead and looked into the virio-win iso packaged in the rhel virtio-win rpm, I found out that its contents differed significantly from what was packaged in that very same rpm as a driver directory hierarchy. Namely, - there are no qxl drivers on the iso, but they are present in the rpm - there are no balloon, qemupciserial, viorng, vioserial in the rpm, but they are present on the iso - qemupciserial is an inf-only 'driver' which matches all windows versions; it's just one copy at the sub-toplevel directory, so it won't pass the virtio_iso_path_matches_guest_os() criteria - there are a lot of duplicates between files for different windows flavors To sum up, the packaging and naming policy of the virtio-win rpm and the virtio-win iso therein are different and neither is clear. Hardcoding the policy in v2v without actually knowing it appears risky at best. We need guidance here from someone who knows how that virtio-win stuff is packaged and how different it is across distros. Any idea whom to contact on the matter?
Anyhow, can you fix up the test at least.
Sure, but I'd like first to figure out how to fix up the code ;) Roman.
On Tue, Oct 27, 2015 at 04:45:00PM +0300, Roman Kagan wrote:
On Tue, Oct 27, 2015 at 12:02:40PM +0000, Richard W.M. Jones wrote:
On Tue, Oct 27, 2015 at 02:08:42PM +0300, Roman Kagan wrote:
On Tue, Oct 27, 2015 at 09:12:41AM +0000, Richard W.M. Jones wrote:
On Mon, Oct 26, 2015 at 09:00:03PM +0300, Roman Kagan wrote:
Windows QXL drivers include also qxldd.dll which used to get filtered out and not copied over into the guest. As a result QXL driver failed to install due to a missing file. (* Skip files without specific extensions. *) - let extensions = ["cat"; "inf"; "pdb"; "sys"] in + let extensions = ["cat"; "dll"; "inf"; "pdb"; "sys"] in
Actually no, this part is (may be) wrong.
This causes WdfCoInstaller*.dll from the ISO to be copied in. It's not clear to me whether these files are needed - I suspect not.
Yes it is, see the corresponding *.inf where it's mentioned in the corresponding CopyFiles directive (and yes, I just verified that with that file missing the balloon driver installation fails with 'file not found' error).
Maybe we should be looking at the CopyFiles directive? (As you may be able to guess, I know next to nothing about how Windows drivers work).
So do I, and parsing the *.inf files is the last thing I'd like to do here; I'm not sure it can be made reliable (I mean, not the parsing, but making any sense out of the parsed data).
However I'm now facing a more serious problem: when I actually went ahead and looked into the virio-win iso packaged in the rhel virtio-win rpm, I found out that its contents differed significantly from what was packaged in that very same rpm as a driver directory hierarchy.
Namely,
- there are no qxl drivers on the iso, but they are present in the rpm
- there are no balloon, qemupciserial, viorng, vioserial in the rpm, but they are present on the iso
- qemupciserial is an inf-only 'driver' which matches all windows versions; it's just one copy at the sub-toplevel directory, so it won't pass the virtio_iso_path_matches_guest_os() criteria
- there are a lot of duplicates between files for different windows flavors
To sum up, the packaging and naming policy of the virtio-win rpm and the virtio-win iso therein are different and neither is clear. Hardcoding the policy in v2v without actually knowing it appears risky at best.
We need guidance here from someone who knows how that virtio-win stuff is packaged and how different it is across distros. Any idea whom to contact on the matter?
Amnon -- CC'd -- I guess? I'm aware that there are at least some differences in paths, and the current virt-v2v code should be able to cope for the two drivers that we really care about - viostor and virtio-net. Of course it can't install drivers that don't exist on either the ISO or the rpm. Rich.
Anyhow, can you fix up the test at least.
Sure, but I'd like first to figure out how to fix up the code ;)
Roman.
-- 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/
participants (2)
-
Richard W.M. Jones -
Roman Kagan