[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-4.1-testing] libxl: do not start a xenpv qemu solely for tap devices if blktap is available



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1316621578 -3600
# Node ID 2112db7c68b3423c7ff9ead91eff5de2d13a13b5
# Parent  7d13e08b51209721fde4979ae59cceda6854877a
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.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
xen-unstable changeset: 23044:d4ca456c0c25
xen-unstable date:      Tue Mar 15 18:19:47 2011 +0000
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 7d13e08b5120 -r 2112db7c68b3 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Sat Sep 17 16:38:31 2011 +0100
+++ b/tools/libxl/libxl_dm.c    Wed Sep 21 17:12:58 2011 +0100
@@ -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);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.