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-changelog

[Xen-changelog] [xen-unstable] xend: Fix scsi_id for pvSCSI

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Fix scsi_id for pvSCSI
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 07 Apr 2009 23:00:32 -0700
Delivery-date: Tue, 07 Apr 2009 23:01:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1238495230 -3600
# Node ID 2d19139c1c9c74a271262f990db6e5a0f3499508
# Parent  1522573509309fdc5ba9348b04622af6de676205
xend: Fix scsi_id for pvSCSI

pvSCSI allocations fail if the version of udev in a host OS is
relatively new.  I have not been able to detect the failure because
I have used udev of the version 095.  The failure occurs by
an incompatibility problem of scsi_id command included udev.
This patch tackles the incompatibility problem.

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 tools/python/xen/util/vscsi_util.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff -r 152257350930 -r 2d19139c1c9c tools/python/xen/util/vscsi_util.py
--- a/tools/python/xen/util/vscsi_util.py       Tue Mar 31 11:26:10 2009 +0100
+++ b/tools/python/xen/util/vscsi_util.py       Tue Mar 31 11:27:10 2009 +0100
@@ -35,6 +35,11 @@ SYSFS_SCSI_DEV_TYPEID_PATH = '/type'
 SYSFS_SCSI_DEV_TYPEID_PATH = '/type'
 SYSFS_SCSI_DEV_REVISION_PATH = '/rev'
 SYSFS_SCSI_DEV_SCSILEVEL_PATH = '/scsi_level'
+
+SCSI_ID_COMMANDS = [
+    "/lib/udev/scsi_id -gu --sg-version 3 -d /dev/%s 2>/dev/null",
+    "/sbin/scsi_id -gu -s /class/scsi_generic/%s 2>/dev/null"
+]
 
 def _vscsi_get_devname_by(name, scsi_devices):
     """A device name is gotten by the HCTL.
@@ -79,9 +84,10 @@ def _vscsi_get_hctl_by(phyname, scsi_dev
 
 
 def _vscsi_get_scsiid(sg):
-    scsi_id = os.popen('/sbin/scsi_id -gu -s /class/scsi_generic/' + 
sg).read().split()
-    if len(scsi_id):
-        return scsi_id[0]
+    for scsi_id_command in SCSI_ID_COMMANDS:
+        scsi_id = os.popen(scsi_id_command % sg).read().split()
+        if len(scsi_id):
+            return scsi_id[0]
     return None
 
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: Fix scsi_id for pvSCSI, Xen patchbot-unstable <=