In case when we are injecting virtio-scsi device driver into the guest
(rather than the default virtio-blk), make sure we write the right PCI ID
value into the Windows guest registry.  This is essential for the guest
to be bootable afterwards.

Originally-by: Roman Kagan <rka...@virtuozzo.com>
Signed-off-by: Andrey Drobyshev <andrey.drobys...@virtuozzo.com>
---
 mlcustomize/inject_virtio_win.ml | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/mlcustomize/inject_virtio_win.ml b/mlcustomize/inject_virtio_win.ml
index 345fe32..922c1ab 100644
--- a/mlcustomize/inject_virtio_win.ml
+++ b/mlcustomize/inject_virtio_win.ml
@@ -207,10 +207,16 @@ let rec inject_virtio_win_drivers ({ g } as t) reg =
         let target = sprintf "%s/system32/drivers/%s.sys"
                              t.i_windows_systemroot driver_name in
         let target = g#case_sensitive_path target in
+        let installed_block_type, legacy_pciid, modern_pciid = (
+          if driver_name = "vioscsi" then
+            Virtio_SCSI, vioscsi_legacy_pciid, vioscsi_modern_pciid
+          else
+            Virtio_blk, viostor_legacy_pciid, viostor_modern_pciid
+        ) in
         g#cp source target;
-        add_guestor_to_registry t reg driver_name viostor_legacy_pciid;
-        add_guestor_to_registry t reg driver_name viostor_modern_pciid;
-        Virtio_blk in
+        add_guestor_to_registry t reg driver_name legacy_pciid;
+        add_guestor_to_registry t reg driver_name modern_pciid;
+        installed_block_type in
 
     (* Can we install the virtio-net driver? *)
     let net : net_type =
-- 
2.31.1

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to