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 4/4] add the scsifront/scsiback userspace scripts

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 4/4] add the scsifront/scsiback userspace scripts
From: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
Date: Wed, 03 Jan 2007 02:58:03 +0900
Delivery-date: Tue, 02 Jan 2007 10:00:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This includes the userspace scripts for scsifront/scsiback.

Now they just exploit blkback/blktap user-space scripts. I will work
on the own format to handle more complicated scsi configurations later
on.


Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>

diff -r 6061275e566f -r c8417a9bd13c tools/examples/Makefile
--- a/tools/examples/Makefile   Wed Jan 03 01:36:42 2007 +0900
+++ b/tools/examples/Makefile   Wed Jan 03 01:37:43 2007 +0900
@@ -22,6 +22,7 @@ XEN_SCRIPTS += network-route vif-route
 XEN_SCRIPTS += network-route vif-route
 XEN_SCRIPTS += network-nat vif-nat
 XEN_SCRIPTS += block
+XEN_SCRIPTS += scsi
 XEN_SCRIPTS += block-enbd block-nbd
 XEN_SCRIPTS += blktap
 XEN_SCRIPTS += vtpm vtpm-delete
diff -r 6061275e566f -r c8417a9bd13c tools/examples/xen-backend.agent
--- a/tools/examples/xen-backend.agent  Wed Jan 03 01:36:42 2007 +0900
+++ b/tools/examples/xen-backend.agent  Wed Jan 03 01:37:43 2007 +0900
@@ -12,6 +12,9 @@ case "$XENBUS_TYPE" in
     ;;
   vbd)
     /etc/xen/scripts/block "$ACTION"
+    ;;
+  scsi)
+    /etc/xen/scripts/scsi "$ACTION"
     ;;
   vtpm)
     /etc/xen/scripts/vtpm "$ACTION"
diff -r 6061275e566f -r c8417a9bd13c tools/examples/xen-backend.rules
--- a/tools/examples/xen-backend.rules  Wed Jan 03 01:36:42 2007 +0900
+++ b/tools/examples/xen-backend.rules  Wed Jan 03 01:37:43 2007 +0900
@@ -1,5 +1,6 @@ SUBSYSTEM=="xen-backend", KERNEL=="tap*"
 SUBSYSTEM=="xen-backend", KERNEL=="tap*", RUN+="/etc/xen/scripts/blktap 
$env{ACTION}"
 SUBSYSTEM=="xen-backend", KERNEL=="vbd*", RUN+="/etc/xen/scripts/block 
$env{ACTION}"
+SUBSYSTEM=="xen-backend", KERNEL=="scsi*", RUN+="/etc/xen/scripts/scsi 
$env{ACTION}"
 SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm 
$env{ACTION}"
 SUBSYSTEM=="xen-backend", KERNEL=="vif*", ACTION=="online", RUN+="$env{script} 
online"
 SUBSYSTEM=="xen-backend", KERNEL=="vif*", ACTION=="offline", 
RUN+="$env{script} offline"
diff -r 6061275e566f -r c8417a9bd13c tools/python/xen/xend/XendDevices.py
--- a/tools/python/xen/xend/XendDevices.py      Wed Jan 03 01:36:42 2007 +0900
+++ b/tools/python/xen/xend/XendDevices.py      Wed Jan 03 01:37:43 2007 +0900
@@ -21,6 +21,7 @@
 
 from xen.xend.server import blkif, netif, tpmif, pciif, iopif, irqif, usbif, 
vfbif
 from xen.xend.server.BlktapController import BlktapController
+from xen.xend.server.SCSIController import SCSIController
 
 class XendDevices:
     """ An ugly halfway point between the module local device name
@@ -43,6 +44,7 @@ class XendDevices:
         'tap': BlktapController,
         'vfb': vfbif.VfbifController,
         'vkbd': vfbif.VkbdifController,
+        'scsi': SCSIController,
     }
 
     #@classmethod
diff -r 6061275e566f -r c8417a9bd13c tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Wed Jan 03 01:36:42 2007 +0900
+++ b/tools/python/xen/xm/create.py     Wed Jan 03 01:37:43 2007 +0900
@@ -534,6 +534,8 @@ def configure_disks(config_devs, vals):
     for (uname, dev, mode, backend) in vals.disk:
         if uname.startswith('tap:'):
             cls = 'tap'
+        elif uname.startswith('scsi:'):
+            cls = 'scsi'
         else:
             cls = 'vbd'
 
diff -r 6061275e566f -r c8417a9bd13c tools/examples/scsi
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/examples/scsi       Wed Jan 03 01:37:43 2007 +0900
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+dir=$(dirname "$0")
+. "$dir/block-common.sh"
+
+log debug "udev event."
+
+case "$command" in
+    add)
+        done=$(xenstore_read_default "$XENBUS_PATH/scsi" 'MISSING')
+       if [ "$done" != 'MISSING' ]
+           then
+           exit 0
+       fi
+
+       xenstore_write "$XENBUS_PATH/scsi" "info"
+       success
+       ;;
+    remove)
+       # TODO
+       ;;
+esac
+
+exit 0
diff -r 6061275e566f -r c8417a9bd13c 
tools/python/xen/xend/server/SCSIController.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/python/xen/xend/server/SCSIController.py    Wed Jan 03 01:37:43 
2007 +0900
@@ -0,0 +1,14 @@
+# Copyright (c) 2005, XenSource Ltd.
+
+
+from xen.xend.server.blkif import BlkifController
+
+
+class SCSIController(BlkifController):
+    def __init__(self, vm):
+        BlkifController.__init__(self, vm)
+        
+    def frontendRoot(self):
+        """@see DevController#frontendRoot"""
+        
+        return "%s/device/scsi" % self.vm.getDomainPath()

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 4/4] add the scsifront/scsiback userspace scripts, FUJITA Tomonori <=