Richard W.M. Jones
2017-Apr-12 22:23 UTC
[Libguestfs] [PATCH virt-v2v] v2v: windows: Install both legacy and modern virtio
Hello Roman, We have a bug with Windows 8 UEFI conversions failing with the usual 0x7B error: https://bugzilla.redhat.com/show_bug.cgi?id=1431579 There is a seemingly plausible theory that this happens because for UEFI we use a qemu Q35 machine type. Q35 machine type implies all-modern PCI-e devices, which implies the use of virtio-1.0 and disabling of virtio legacy. Virtio-1.0 uses different Windows registry keys: viostor changes from VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00 -> VEN_1AF4&DEV_1042&SUBSYS_11001AF4&REV_01, and vioscsi has a similar change. As we are only installing the virtio legacy key, but presenting PCI-e virtio-1.0 (modern) devices to the guest, this may cause Windows to fail to boot. I have not gone beyond compile-testing the attached patch, but what do you think? I will try to actually test this tomorrow, but I wondered if you have any comments. Thanks, Rich.
Richard W.M. Jones
2017-Apr-12 22:23 UTC
[Libguestfs] [PATCH virt-v2v] v2v: windows: Install both legacy and modern virtio keys in the registry (RHBZ#1431579).
--- v2v/windows_virtio.ml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml index 6c9708c03..9891a770c 100644 --- a/v2v/windows_virtio.ml +++ b/v2v/windows_virtio.ml @@ -36,8 +36,10 @@ let virtio_win else Guestfs_config.datadir // "virtio-win" let scsi_class_guid = "{4D36E97B-E325-11CE-BFC1-08002BE10318}" -let viostor_pciid = "VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00" -let vioscsi_pciid = "VEN_1AF4&DEV_1004&SUBSYS_00081AF4&REV_00" +let viostor_legacy_pciid = "VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00" +let viostor_modern_pciid = "VEN_1AF4&DEV_1042&SUBSYS_11001AF4&REV_01" +let vioscsi_legacy_pciid = "VEN_1AF4&DEV_1004&SUBSYS_00081AF4&REV_00" +let vioscsi_modern_pciid = "VEN_1AF4&DEV_1048&SUBSYS_11001AF4&REV_01" let rec install_drivers ((g, _) as reg) inspect rcaps (* Copy the virtio drivers to the guest. *) @@ -104,7 +106,8 @@ let rec install_drivers ((g, _) as reg) inspect rcaps inspect.i_windows_systemroot driver_name in let target = g#case_sensitive_path target in g#cp source target; - add_guestor_to_registry reg inspect driver_name viostor_pciid; + add_guestor_to_registry reg inspect driver_name viostor_legacy_pciid; + add_guestor_to_registry reg inspect driver_name viostor_modern_pciid; Virtio_blk | Some Virtio_SCSI, _, true -> @@ -115,7 +118,8 @@ let rec install_drivers ((g, _) as reg) inspect rcaps inspect.i_windows_systemroot in let target = g#case_sensitive_path target in g#cp source target; - add_guestor_to_registry reg inspect "vioscsi" vioscsi_pciid; + add_guestor_to_registry reg inspect "vioscsi" vioscsi_legacy_pciid; + add_guestor_to_registry reg inspect "vioscsi" vioscsi_modern_pciid; Virtio_SCSI | Some IDE, _, _ -> -- 2.12.0
Richard W.M. Jones
2017-Apr-13 12:33 UTC
Re: [Libguestfs] [PATCH virt-v2v] v2v: windows: Install both legacy and modern virtio keys in the registry (RHBZ#1431579).
On Thu, Apr 13, 2017 at 11:37:31AM +0300, Roman Kagan wrote:> Appears reasonable; however, I'm afraid it's only the experiment that > can tell if it can work or not, and I don't have a setup to test this > right now.Thanks. I managed to test it now, and it does appear to fix the problem, so I pushed this commit upstream. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Reasonably Related Threads
- [COMMON PATCH v2 0/4] Bring support for virtio-scsi back to Windows
- [COMMON PATCH v3 0/4] Bring support for virtio-scsi back to Windows
- [COMMON PATCH v3 1/4] inject_virtio_win: match only vendor/device/revision
- [COMMON PATCH v2 1/4] inject_virtio_win: match only vendor/device
- [COMMON PATCH v2 4/4] inject_virtio_win: write the proper block controller PCI ID to Win registry