If virtio-scsi is present among the tools for this version of Windows,
prefer it over virtio-blk.
Originally-by: Roman Kagan <rkagan(a)virtuozzo.com>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev(a)virtuozzo.com>
---
mlcustomize/inject_virtio_win.ml | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/mlcustomize/inject_virtio_win.ml b/mlcustomize/inject_virtio_win.ml
index 62f7710..751a9b0 100644
--- a/mlcustomize/inject_virtio_win.ml
+++ b/mlcustomize/inject_virtio_win.ml
@@ -176,7 +176,8 @@ let rec inject_virtio_win_drivers ({ g } as t) reg =
else (
(* Can we install the block driver? *)
let block : block_type =
- let filenames = ["virtio_blk"; "vrtioblk"; "viostor"]
in
+ (* First list item is the default driver. *)
+ let filenames = ["vioscsi"; "virtio_blk"; "vrtioblk";
"viostor"] in
let viostor_driver = try (
Some (
List.find (
@@ -200,10 +201,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 legacy_pciid, modern_pciid = (
+ if driver_name = "vioscsi" then
+ vioscsi_legacy_pciid, vioscsi_modern_pciid
+ else
+ 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;
+ (if driver_name = "vioscsi" then Virtio_SCSI else Virtio_blk) in
(* Can we install the virtio-net driver? *)
let net : net_type =
--
2.31.1