Skip to contentSkip to conversation

tools/hotplug/Linux/block: fix shared loop device detection

PATCH Applied Zhigang Wang 3 participants 3 messages Jul 6, 2011 – Jul 8, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/hotplug/Linux/block: fix shared loop device detection

# HG changeset patch
# User Zhigang Wang <[email protected]>
# 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)
tools/hotplug/Linux/block +1 -1
diff -r 2f63562df1c4 -r 52449dfa9035 tools/hotplug/Linux/block
@@ -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" ]
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Zhigang Wang

# HG changeset patch
# User Zhigang Wang <[email protected]>
# Date 1309991886 14400
# Node ID 52449dfa903562aa563fef0d229e2dc61a768f4c # Parent 2f63562df1c4230492a81793dce3672f93c93d9a tools/hotplug/Linux/block: fix shared loop device detection

Quoted 8 lines

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

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

The leading zero was in the 4.0 code. Thanks for spotting.

Olaf

Applied
#2 lore raw
In reply to Zhigang Wang

Zhigang Wang writes ("[Xen-devel] [PATCH] tools/hotplug/Linux/block: fix shared loop device detection"):

Quoted 3 lines

tools/hotplug/Linux/block: fix shared loop device detection

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

Thanks, applied.

Ian.