]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
libxl: do not start a xenpv qemu solely for tap devices if blktap is available
authorIan Campbell <ian.campbell@citrix.com>
Wed, 21 Sep 2011 16:12:58 +0000 (17:12 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 21 Sep 2011 16:12:58 +0000 (17:12 +0100)
qemu is used as a fallback for DISK_BACKEND_TAP if no blktap is
available but if blktap is available, or for DISK_BACKEND_PHY, we
don't need a qemu process.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 23044:d4ca456c0c25
xen-unstable date:      Tue Mar 15 18:19:47 2011 +0000
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_dm.c

index d535e11a76dd120a66a971a243908ecfa3975188..1ffcc909f804798bf060d395c8bd3d399c2499a7 100644 (file)
@@ -828,8 +828,29 @@ int libxl__need_xenpv_qemu(libxl_ctx *ctx,
         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);