WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] libxl: do not start a xenpv qemu solely for tap devi

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libxl: do not start a xenpv qemu solely for tap devices if blktap is available
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Tue, 15 Mar 2011 10:18:03 +0000
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Tue, 15 Mar 2011 03:18:59 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# 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.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 3b7471b486b5 -r 1e18165335b0 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Tue Mar 15 10:07:09 2011 +0000
+++ b/tools/libxl/libxl_dm.c    Tue Mar 15 10:16:57 2011 +0000
@@ -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);

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

<Prev in Thread] Current Thread [Next in Thread>