Skip to contentSkip to conversation

libxl: do not start a xenpv qemu solely for tap devices if blktap is available

PATCH Applied Ian Campbell 3 participants 3 messages Mar 15, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: do not start a xenpv qemu solely for tap devices if blktap is available

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300184217 0
# Node ID 1e18165335b02171ae1ff2ba426086004c34938c
# Parent 3b7471b486b5282138fbe202f996ea80230252b3
libxl: do not start a xenpv qemu solely for tap devices if blktap is available

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.

tools/libxl/libxl_dm.c +23 -2
diff -r 3b7471b486b5 -r 1e18165335b0 tools/libxl/libxl_dm.c
@@ -840,8 +840,29 @@ int libxl__need_xenpv_qemu(libxl_ctx *ct
         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);
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300184217 0
# Node ID 1e18165335b02171ae1ff2ba426086004c34938c
# Parent 3b7471b486b5282138fbe202f996ea80230252b3
libxl: do not start a xenpv qemu solely for tap devices if blktap is available

Quoted 5 lines

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.

Applied
#2 lore raw
In reply to Ian Campbell

Ian Campbell writes ("[Xen-devel] [PATCH] libxl: do not start a xenpv qemu solely for tap devices if blktap is available"):

Quoted 1 line

libxl: do not start a xenpv qemu solely for tap devices if blktap is available

Applied to unstable, thanks.

Ian.