[Libguestfs] [PATCH 1/4] v2v: win <= 7: reduce registry patch

Roman Kagan rkagan at virtuozzo.com
Wed Apr 6 17:24:45 UTC 2016


The patch to the Windows registry allowing it to boot off a virtio-blk
drive was initially conceived by comparing the state with virtio-blk
driver properly installed, to that without.

However, we don't want to replicate the Windows PnP system; rather we
need to apply just enough edits to make the system boot, and then let
the Windows PnP manager figure out the rest.

It turned out that for Windows <= 7 / 2008R2 the "just enough" set
includes only the service entry for the driver, and a
CriticalDeviceDatabase entry matching the PCI id of the device and
pointing at that service entry.

While at this, also drop CriticalDeviceDatabase entries for older and
no longer relevant PCI ids of the virtio-blk device.

Tested on

Win XP SP3 x32
Win XP SP2 x64
Win 2003R2 SP2 x32
Win 2003R2 SP2 x63
Win Vista SP2 x32
Win Vista SP2 x64
Win 2008 SP2 x32
Win 2008R2 SP1 x64
Win 7 SP1 x32
Win 7 SP1 x64

Signed-off-by: Roman Kagan <rkagan at virtuozzo.com>
---
 v2v/windows_virtio.ml | 36 +-----------------------------------
 1 file changed, 1 insertion(+), 35 deletions(-)

diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml
index ba87aa6..7796a0f 100644
--- a/v2v/windows_virtio.ml
+++ b/v2v/windows_virtio.ml
@@ -147,18 +147,6 @@ and add_viostor_to_critical_device_database g root current_cs =
    * hive may be modified here.
    *)
   let regedits = [
-      [ current_cs; "Control"; "CriticalDeviceDatabase"; "pci#ven_1af4&dev_1001&subsys_00000000" ],
-      [ "Service", REG_SZ "viostor";
-        "ClassGUID", REG_SZ "{4D36E97B-E325-11CE-BFC1-08002BE10318}" ];
-
-      [ current_cs; "Control"; "CriticalDeviceDatabase"; "pci#ven_1af4&dev_1001&subsys_00020000" ],
-      [ "Service", REG_SZ "viostor";
-        "ClassGUID", REG_SZ "{4D36E97B-E325-11CE-BFC1-08002BE10318}" ];
-
-      [ current_cs; "Control"; "CriticalDeviceDatabase"; "pci#ven_1af4&dev_1001&subsys_00021af4" ],
-      [ "Service", REG_SZ "viostor";
-        "ClassGUID", REG_SZ "{4D36E97B-E325-11CE-BFC1-08002BE10318}" ];
-
       [ current_cs; "Control"; "CriticalDeviceDatabase"; "pci#ven_1af4&dev_1001&subsys_00021af4&rev_00" ],
       [ "Service", REG_SZ "viostor";
         "ClassGUID", REG_SZ "{4D36E97B-E325-11CE-BFC1-08002BE10318}" ];
@@ -168,29 +156,7 @@ and add_viostor_to_critical_device_database g root current_cs =
         "Start", REG_DWORD 0x0_l;
         "Group", REG_SZ "SCSI miniport";
         "ErrorControl", REG_DWORD 0x1_l;
-        "ImagePath", REG_EXPAND_SZ "system32\\drivers\\viostor.sys";
-        "Tag", REG_DWORD 0x21_l ];
-
-      [ current_cs; "Services"; "viostor"; "Parameters" ],
-      [ "BusType", REG_DWORD 0x1_l ];
-
-      [ current_cs; "Services"; "viostor"; "Parameters"; "MaxTransferSize" ],
-      [ "ParamDesc", REG_SZ "Maximum Transfer Size";
-        "type", REG_SZ "enum";
-        "default", REG_SZ "0" ];
-
-      [ current_cs; "Services"; "viostor"; "Parameters"; "MaxTransferSize"; "enum" ],
-      [ "0", REG_SZ "64  KB";
-        "1", REG_SZ "128 KB";
-        "2", REG_SZ "256 KB" ];
-
-      [ current_cs; "Services"; "viostor"; "Parameters"; "PnpInterface" ],
-      [ "5", REG_DWORD 0x1_l ];
-
-      [ current_cs; "Services"; "viostor"; "Enum" ],
-      [ "0", REG_SZ "PCI\\VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00\\3&13c0b0c5&0&20";
-        "Count", REG_DWORD 0x1_l;
-        "NextInstance", REG_DWORD 0x1_l ];
+        "ImagePath", REG_EXPAND_SZ "system32\\drivers\\viostor.sys" ];
     ] in
 
   reg_import g root regedits
-- 
2.5.5




More information about the Libguestfs mailing list