mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
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@oracle.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
89758766e5
commit
bd86a4611d
1 file changed
+1
-1
@@ -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" ]
|
||||
|
||||