[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] tools: fix shared loop device detection in block hotplug script



# HG changeset patch
# User Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
# Date 1310145146 -3600
# Node ID 443c6a7b6079f490d9adbb46352c20c2628fb144
# Parent  0648846b4d17c5b09c11ffe48a49fbb7616f630e
tools: fix shared loop device detection in block hotplug script

We need to cope with 0 or more '0' prefixed 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>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 0648846b4d17 -r 443c6a7b6079 tools/hotplug/Linux/block
--- a/tools/hotplug/Linux/block Fri Jul 08 18:10:48 2011 +0100
+++ b/tools/hotplug/Linux/block Fri Jul 08 18:12:26 2011 +0100
@@ -280,7 +280,7 @@
           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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.