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

Re: [Xen-devel] [patch] loopback block device confliction is fixed.

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [patch] loopback block device confliction is fixed.
From: "Satoshi Uchida" <s-uchida@xxxxxxxxxxxxx>
Date: Wed, 30 Nov 2005 15:20:40 +0900
Delivery-date: Wed, 30 Nov 2005 06:20:37 +0000
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/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
Thread-index: AcX1YUP35oi2pfXVQriCOADsC55lrAAElbkwAACalZA=
Hi.

Sorry.
My past patch cannot solve confliction problems, but can decrease its
occurrence.
And, when loopback devices mounted become fragment, sharing cannot
checked for all loopback devices.

Therefore, I create new patch.
This patch is to stock candidate devices at first stage ( searching and
sharing check stage), and to try to assign loopback devices within
candidate devise gradually.

Thanks

Satoshi UCHIDA

 
diff -r 243265ade404 tools/examples/block
--- a/tools/examples/block      Mon Nov 28 17:22:02 2005
+++ b/tools/examples/block      Wed Nov 30 15:08:26 2005
@@ -202,7 +202,7 @@
 mount it read-write in a guest domain."
         fi
 
-        loopdev=''
+        loopdevs=''
 
        for dev in /dev/loop*
         do
@@ -235,26 +235,26 @@
             # $dev is not in use, so we'll remember it for use later;
we want
             # to finish the sharing check first.
             
-            if [ "$loopdev" == '' ]
-            then
-              loopdev="$dev"
-            fi
+            loopdevs="$loopdevs $dev"
           fi
         done
 
-        if [ "$loopdev" == '' ]
+        if [ "$loopdevs" == '' ]
         then
           fatal 'Failed to find an unused loop device'
         fi
 
-        if losetup "$loopdev" "$file"
-        then
-          xenstore_write "$XENBUS_PATH/node" "$loopdev"
-          write_dev "$loopdev"
-          exit 0
-        else
-          fatal "losetup $loopdev $file failed"
-        fi
+       for loopdev in $loopdevs
+       do
+         if losetup "$loopdev" "$file"
+         then
+            xenstore_write "$XENBUS_PATH/node" "$loopdev"
+            write_dev "$loopdev"
+            exit 0
+          fi
+        done
+
+       fatal "losetup $loopdev $file failed"
        ;;
     esac
     ;;

Attachment: block.patch-new
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>