-
Notifications
You must be signed in to change notification settings - Fork 9
mlcustomize/inject_virtio_win.ml: Use viostor.inf instead of guestor #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
After this patch, |
|
Small comments for this code:
But using a win11 VM I narrowed down the actual fix to just the I can't tell the original intention of the guestor naming... was it to keep the entry name generic enough that it could cover viostor or vioscsi? Also I have no idea what drv_config is actually supposed to be. More data points: It seems like multiple chatgpt claims the hex string is a checksum windows calculates at driver install time but it can't provide an authoritative reference. seems valid though: installing different driver versions via virtio-win-guest-tools.exe gives different values, and re-installing gives the same values. i'm guessing it's just to avoid registry entry naming collisions, not used for any sort of validation. |
Interestingly I thought that all the changes were needed, but I'm not sure if I tried only changing The I chose Note also I completely forgot about vioscsi installation (via the Let me see if I can reproduce your more minimal fix. |
After conversion, we found that Microsoft's pnputil utility could not list drivers. It would fail with: > pnputil /e > [some drivers listed] > Failed to enumerate driver packages: The parameter is incorrect. and an errorlevel of 87 (0x57, ERROR_INVALID_PARAMETER). Also Windows Update could be affected. This is really a bug in pnputil, but we have to work around it. This is apparently happening because pnputil and/or the underlying APIs in Windows cannot handle the guestor "driver" that we temporarily added to enable viostor, before real viostor gets installed on the first boot after conversion. There is something malformed about the Windows registry entries or something else. Probably for the same reason, it was not possible to disable or remove the guestor driver from within Windows, although we did publish instructions on how to do it from outside Windows (commit d0bc03b643 "docs: Document fix for updating converted Windows guests after conversion"). After much trial and error Cole Robinson found that the problem is specific to the 'SYSTEM\DriverDatabase\DriverPackages\guestor_tmp' key. This appears to be validated by pnputil. If we change the format to match the name of existing keys, then it works. A note about: 'guestor.inf_amd64_0000000000000000' (drv_inf_label). The real viostor driver uses 'viostor.inf_amd64_aaadc7282ed35504'. I'm not clear if the hex digits are different for each build or how they vary. However I found that using all zeroes works fine. An examination of the registry after the guest has been converted and booted shows the 'guestor.inf_amd64_0000000000000000' key is still present (as well as the real 'viostor.inf_amd64_aaadc7282ed35504' key), but apparently this does not affect pnputil. Updates: commit d56170211c427740e174b96e7274148bcb91ae46 Fixes: https://issues.redhat.com/browse/RHEL-112517 Related: commit d0bc03b6434c775b724a4950dd0d1a25876e5bea Related: https://issues.redhat.com/browse/MTV-2256 Thanks: Cole Robinson
ad41570 to
ebcd4d5
Compare
|
The updated version is the more minimal change, matching what Cole said above. I tested it and it still works for me. I also stopped hard-coding the arch. |
crobinso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I think it's fine to push
Richard W.M. Jones (2):
daemon, generator: Use power of 2 for initial size of Hashtbl.create
mlcustomize/inject_virtio_win.ml: Use viostor.inf instead of guestor
See-also: libguestfs/libguestfs-common#17
Richard W.M. Jones (3):
mlstdutils: Export List.find_opt
daemon, generator: Use power of 2 for initial size of Hashtbl.create
mlcustomize/inject_virtio_win.ml: Use viostor.inf instead of guestor
See-also: libguestfs/libguestfs-common#17
Richard W.M. Jones (3):
mlstdutils: Export List.find_opt
daemon, generator: Use power of 2 for initial size of Hashtbl.create
mlcustomize/inject_virtio_win.ml: Use viostor.inf instead of guestor
See-also: libguestfs/libguestfs-common#17
(cherry picked from commit 13bcff3)
Richard W.M. Jones (3):
mlstdutils: Export List.find_opt
daemon, generator: Use power of 2 for initial size of Hashtbl.create
mlcustomize/inject_virtio_win.ml: Use viostor.inf instead of guestor
See-also: libguestfs/libguestfs-common#17
(cherry picked from commit 13bcff3)
Richard W.M. Jones (3):
mlstdutils: Export List.find_opt
daemon, generator: Use power of 2 for initial size of Hashtbl.create
mlcustomize/inject_virtio_win.ml: Use viostor.inf instead of guestor
See-also: libguestfs/libguestfs-common#17
After conversion, we found that Microsoft's pnputil utility could not list drivers. It would fail with:
and an errorlevel of 87 (0x57, ERROR_INVALID_PARAMETER). Also Windows Update could be affected. This is really a bug in pnputil, but we have to work around it.
This is apparently happening because pnputil and/or the underlying APIs in Windows cannot handle the guestor "driver" that we temporarily added to enable viostor, before real viostor gets installed on the first boot after conversion. There is something malformed about the Windows registry entries or something else.
Probably for the same reason, it was not possible to disable or remove the guestor driver from within Windows, although we did publish instructions on how to do it from outside Windows (commit d0bc03b643 "docs: Document fix for updating converted Windows guests after conversion").
A better way to do this would be to go back to installing a partial viostor driver. The real viostor installer will then fix the registry entries correctly at first boot, and there will no longer be any 'guestor' entries.
A note about: 'viostor.inf_amd64_0000000000000000' (drv_inf_label). The real viostor driver uses 'viostor.inf_amd64_aaadc7282ed35504'. I'm not clear if the hex digits are different for each build or how they vary. However I found that using all zeroes works fine. An examination of the registry after the guest has been converted and booted shows the 'viostor.inf_amd64_0000000000000000' key is still present (as well as the real 'viostor.inf_amd64_aaadc7282ed35504' key), but apparently this does not affect pnputil.
This partially reverts virt-v2v commit d56170211c ("v2v: win >= 8: simplify registry patching")
Reverts: commit d56170211c427740e174b96e7274148bcb91ae46
Fixes: https://issues.redhat.com/browse/RHEL-112517
Related: commit d0bc03b6434c775b724a4950dd0d1a25876e5bea
Related: https://issues.redhat.com/browse/MTV-2256