From ebcd4d5eccf96327069f5bcafe65b897261a44e4 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 17 Sep 2025 15:15:28 +0100 Subject: [PATCH] mlcustomize/inject_virtio_win.ml: Use viostor.inf instead of guestor 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 --- mlcustomize/inject_virtio_win.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mlcustomize/inject_virtio_win.ml b/mlcustomize/inject_virtio_win.ml index b26b14d..114df06 100644 --- a/mlcustomize/inject_virtio_win.ml +++ b/mlcustomize/inject_virtio_win.ml @@ -310,8 +310,13 @@ and ddb_regedits inspect drv_name drv_pciid = * one must add keys into the DriverDatabase. *) + let winarch = + match inspect.i_arch with + | "i386" -> "x86" | "x86_64" -> "amd64" + | _ -> assert false in + let drv_inf = "guestor.inf" in - let drv_inf_label = drv_inf ^ "_tmp" in + let drv_inf_label = sprintf "%s_%s_0000000000000000" drv_inf winarch in let drv_config = "guestor_conf" in [