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] hotplug: allow hardlinked files for block device ima

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] hotplug: allow hardlinked files for block device images
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Fri, 26 Nov 2010 14:55:55 +0100
Delivery-date: Fri, 26 Nov 2010 06:28:05 -0800
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1290779761; l=1247; s=domk; d=aepfle.de; h=Content-Type:MIME-Version:Subject:To:From:Date:X-RZG-CLASS-ID: X-RZG-AUTH; bh=TkpM4OkOsmVqxWlukfrf56+Uwls=; b=uXshiYdXYg17M8gprTsohUdQi46d/Hdrh15fWdaAvY3UIzIsoajz4A8fuM24TGaL34f YjsRrf9frNrN7BSpc/Ti1H0NILDzDwOmWX2I6Lagi+/ijZk95g2ujehqyjQ47qg/jLqfF 6ROIETsdaVzkYo+auxux5kJh/dGHSCusMNQ=
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: Mutt/1.5.20 (2009-06-14)
tools/hotplug/Linux/block change for this losetup -a output:
(inode 12 is listed twice due to hardlinks)

/dev/loop0: [0809]:139267 (/abuild/vdisk-sles11_2-disk0)
/dev/loop1: [0809]:139266 (/abuild/vdisk-sles11_1-disk1)
/dev/loop3: [0809]:139267 (/abuild/vdisk-sles11_2-disk0)
/dev/loop5: [0809]:139273 (/abuild/vdisk-sles11_5-disk1)
/dev/loop8: [0809]:12 (/abuild/bootiso-xenpaging-sles11_5.iso)
/dev/loop10: [0809]:12 (/abuild/bootiso-xenpaging-sles11_4.iso)
/dev/loop11: [0809]:139271 (/abuild/vdisk-sles11_4-disk0)

Without this change, $dev would contain /dev/loop8\n/dev/loop10
Applies to 4.0 and 4.1

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

---
 tools/hotplug/Linux/block |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- xen-4.0.1-testing.orig/tools/hotplug/Linux/block
+++ xen-4.0.1-testing/tools/hotplug/Linux/block
@@ -279,8 +279,8 @@ mount it read-write in a guest domain."
             fatal "Unable to lookup $file: dev: $dev inode: $inode"
           fi
 
-          shared_list=$(losetup -a | grep ' \[0*'${dev}'\]:'${inode} |
-                cut -d : -f 1)
+          shared_list=$(losetup -a |
+                sed -n -e 
"s@^\([^:]\+\)\(:[[:blank:]]\[${dev}\]:${inode}[[:blank:]](${file})\)@\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>
  • [Xen-devel] [PATCH] hotplug: allow hardlinked files for block device images, Olaf Hering <=