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] tools/hotplug/Linux/block: fix shared loop device de

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] tools/hotplug/Linux/block: fix shared loop device detection
From: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
Date: Wed, 6 Jul 2011 15:39:33 -0700 (PDT)
Cc: zhigang.x.wang@xxxxxxxxxx
Delivery-date: Wed, 06 Jul 2011 15:42:42 -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
User-agent: Mercurial-patchbomb/1.8.4+40-99a7cd924636
# HG changeset patch
# User Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
# Date 1309991886 14400
# Node ID 52449dfa903562aa563fef0d229e2dc61a768f4c
# Parent  2f63562df1c4230492a81793dce3672f93c93d9a
tools/hotplug/Linux/block: fix shared loop device detection

We need to prefix 0 or more '0' to '$dev':

  # stat -c '%D' "/system.img"
  13
  # losetup -a
  /dev/loop0: [0013]:12062248 (/system.img)

Signed-off-by: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>

diff -r 2f63562df1c4 -r 52449dfa9035 tools/hotplug/Linux/block
--- a/tools/hotplug/Linux/block Mon Jun 27 17:37:12 2011 +0100
+++ b/tools/hotplug/Linux/block Wed Jul 06 18:38:06 2011 -0400
@@ -280,7 +280,7 @@ mount it read-write in a guest domain."
           fi
 
           shared_list=$(losetup -a |
-                sed -n -e 
"s@^\([^:]\+\)\(:[[:blank:]]\[${dev}\]:${inode}[[:blank:]](.*)\)@\1@p" )
+                sed -n -e 
"s@^\([^:]\+\)\(:[[:blank:]]\[0*${dev}\]:${inode}[[:blank:]](.*)\)@\1@p" )
           for dev in $shared_list
           do
             if [ -n "$dev" ]

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

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