summaryrefslogtreecommitdiff
blob: ba72c497aa687e464bc2e86426073bc15122149d (plain)
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
Index: xen-tools-4.1.1/tools/libxl/libxl_dm.c
===================================================================
--- xen-4.1.1.orig/tools/libxl/libxl_dm.c	Tue Mar 15 10:14:27 2011 +0000
+++ xen-4.1.1/tools/libxl/libxl_dm.c	Tue Mar 15 18:19:47 2011 +0000
@@ -828,8 +828,29 @@
         goto out;
     }
 
-    if (nr_disks > 0 && !libxl__blktap_enabled(&gc))
-        ret = 1;
+    if (nr_disks > 0) {
+        int blktap_enabled = -1;
+        for (i = 0; i < nr_disks; i++) {
+            switch (disks[i].backend) {
+            case DISK_BACKEND_TAP:
+                if (blktap_enabled == -1)
+                    blktap_enabled = libxl__blktap_enabled(&gc);
+                if (!blktap_enabled) {
+                    ret = 1;
+                    goto out;
+                }
+                break;
+
+            case DISK_BACKEND_QDISK:
+                ret = 1;
+                goto out;
+
+            case DISK_BACKEND_PHY:
+            case DISK_BACKEND_UNKNOWN:
+                break;
+            }
+        }
+    }
 
 out:
     libxl__free_all(&gc);