-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy path1008-libxl-Force-emulating-readonly-disks-as-SCSI.patch
41 lines (36 loc) · 1.61 KB
/
1008-libxl-Force-emulating-readonly-disks-as-SCSI.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 16441a7526d355dc4150e30cd1062b6626de2305 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Wed, 16 Nov 2022 01:48:34 +0100
Subject: [PATCH] libxl: Force emulating readonly disks as SCSI
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
IDE and AHCI emulation in qemu-xen does not support read-only disks.
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
tools/libs/light/libxl_dm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 7fd53df13ed0..ed2772ab0456 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1364,7 +1364,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
if (disks[i].is_cdrom) {
continue;
}
- if (strncmp(disks[i].vdev, "sd", 2) == 0) {
+ if (strncmp(disks[i].vdev, "sd", 2) == 0 || !disks[i].readwrite) {
flexarray_vappend(dm_args, "-device", "lsi53c895a", NULL);
break;
}
@@ -1952,7 +1952,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
colo_mode = LIBXL__COLO_NONE;
}
- if (strncmp(disks[i].vdev, "sd", 2) == 0) {
+ if (strncmp(disks[i].vdev, "sd", 2) == 0 || !disks[i].readwrite) {
const char *drive_id;
if (colo_mode == LIBXL__COLO_SECONDARY) {
drive = libxl__sprintf
--
2.44.0