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] blktap2: seperate blktap1/blktap2 disk types

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] blktap2: seperate blktap1/blktap2 disk types
From: "Ryan O'Connor" <rjo@xxxxxxxxx>
Date: Thu, 02 Jul 2009 23:20:03 -0700
Cc: dmeyer@xxxxxxxxx, kanno.masaki@xxxxxxxxxxxxxx, keir.fraser@xxxxxxxxxxxxx
Delivery-date: Thu, 02 Jul 2009 23:21:52 -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 Ryan O'Connor <rjo@xxxxxxxxx>
# Date 1246601791 25200
# Node ID e003f10a67e4cd7ab6d22304638b924ebf8e8e3f
# Parent  d461c4d8af17c86dc7e4a1ff730f85634e73eb26
blktap2: seperate blktap1/blktap2 disk types

 * seperate blktap1/blktap2 disk types
 * use blktap1 when driver is not in explicit list of blktap2 drivers, rather
   than current check against list of blktap1 only drivers
 * remove 'tapdisk' disk type (it is not a tapdisk disk type) and fix tapdisk
   disk type check in XenConfig

Signed-off-by: Ryan O'Connor <rjo@xxxxxxxxx>

diff -r d461c4d8af17 -r e003f10a67e4 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Thu Jul 02 21:45:30 2009 +0100
+++ b/tools/python/xen/xend/XendConfig.py       Thu Jul 02 23:16:31 2009 -0700
@@ -1379,9 +1379,13 @@ class XendConfig(dict):
                 else:
                     # Save uname for next domain start.
                     dev_info['required_uname'] = dev_info['uname']
-                if dev_info['uname'].split(':')[1] not in blktap_disk_types:
+                tap_disk_type = dev_info['uname'].split(':')[1]
+                # tapdisk uname may be 'tap:<driver>' or 'tap:tapdisk:<driver>'
+                if tap_disk_type == 'tapdisk':
+                    tap_disk_type = dev_info['uname'].split(':')[2]
+                if tap_disk_type not in blktap_disk_types:
                     raise XendConfigError("tap:%s not a valid disk type" %
-                                    dev_info['uname'].split(':')[1])
+                                    tap_disk_type)
 
             if dev_type == 'vif':
                 if not dev_info.get('mac'):
diff -r d461c4d8af17 -r e003f10a67e4 
tools/python/xen/xend/server/BlktapController.py
--- a/tools/python/xen/xend/server/BlktapController.py  Thu Jul 02 21:45:30 
2009 +0100
+++ b/tools/python/xen/xend/server/BlktapController.py  Thu Jul 02 23:16:31 
2009 -0700
@@ -13,17 +13,24 @@ TAPDISK_DEVICE  = '/dev/xen/blktap-2/tap
 TAPDISK_DEVICE  = '/dev/xen/blktap-2/tapdev'
 TAPDISK_CONTROL = TAPDISK_SYSFS + '/blktap'
 
-blktap_disk_types = [
+blktap1_disk_types = set([
     'aio',
     'sync',
     'vmdk',
     'ram',
     'qcow',
     'qcow2',
+    'ioemu',
+    ])
+
+blktap2_disk_types = set([
+    'aio',
+    'ram',
+    'qcow',
     'vhd',
-    'ioemu',
-    'tapdisk',
-    ]
+    ])
+
+blktap_disk_types = blktap1_disk_types | blktap2_disk_types
 
 def doexec(args, inputtext=None):
     """Execute a subprocess, then return its return code, stdout and stderr"""
@@ -151,7 +158,7 @@ class Blktap2Controller(BlktapController
 
         if typ in ('tap'):
             if subtyp in ('tapdisk'):
-                if params in ('ioemu', 'qcow2', 'vmdk', 'sync') or not 
blktap2_installed:
+                if params not in blktap2_disk_types or not blktap2_installed:
                     # pass this device off to BlktapController
                     log.warn('WARNING: using deprecated blktap module')
                     self.deviceClass = 'tap'

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] blktap2: seperate blktap1/blktap2 disk types, Ryan O'Connor <=