All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hotplug: allow hardlinked files for block device images
@ 2010-11-26 13:55 Olaf Hering
  2011-01-16 14:43 ` Olaf Hering
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Olaf Hering @ 2010-11-26 13:55 UTC (permalink / raw)
  To: xen-devel

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@aepfle.de>

---
 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" ]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hotplug: allow hardlinked files for block device images
  2010-11-26 13:55 [PATCH] hotplug: allow hardlinked files for block device images Olaf Hering
@ 2011-01-16 14:43 ` Olaf Hering
  2011-01-16 15:14   ` Keir Fraser
  2011-01-17 10:59 ` Stefano Stabellini
  2011-01-17 15:48 ` Paolo Bonzini
  2 siblings, 1 reply; 8+ messages in thread
From: Olaf Hering @ 2011-01-16 14:43 UTC (permalink / raw)
  To: xen-devel


Ping?


On Fri, Nov 26, Olaf Hering wrote:

> 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@aepfle.de>
> 
> ---
>  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" ]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: [PATCH] hotplug: allow hardlinked files for block device images
  2011-01-16 14:43 ` Olaf Hering
@ 2011-01-16 15:14   ` Keir Fraser
  0 siblings, 0 replies; 8+ messages in thread
From: Keir Fraser @ 2011-01-16 15:14 UTC (permalink / raw)
  To: Olaf Hering, xen-devel; +Cc: ian.jackson, Stefano Stabellini

Needs an Ack, or to be applied, by a tools maintainer.

 -- Keir

On 16/01/2011 14:43, "Olaf Hering" <olaf@aepfle.de> wrote:

> 
> Ping?
> 
> 
> On Fri, Nov 26, Olaf Hering wrote:
> 
>> 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@aepfle.de>
>> 
>> ---
>>  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@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hotplug: allow hardlinked files for block device images
  2010-11-26 13:55 [PATCH] hotplug: allow hardlinked files for block device images Olaf Hering
  2011-01-16 14:43 ` Olaf Hering
@ 2011-01-17 10:59 ` Stefano Stabellini
  2011-01-17 15:48 ` Paolo Bonzini
  2 siblings, 0 replies; 8+ messages in thread
From: Stefano Stabellini @ 2011-01-17 10:59 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel@lists.xensource.com

On Fri, 26 Nov 2010, Olaf Hering wrote:
> 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@aepfle.de>
> 

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hotplug: allow hardlinked files for block device images
  2010-11-26 13:55 [PATCH] hotplug: allow hardlinked files for block device images Olaf Hering
  2011-01-16 14:43 ` Olaf Hering
  2011-01-17 10:59 ` Stefano Stabellini
@ 2011-01-17 15:48 ` Paolo Bonzini
  2011-01-17 15:57   ` Olaf Hering
  2 siblings, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2011-01-17 15:48 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel, Stefano Stabellini

On 11/26/2010 02:55 PM, Olaf Hering wrote:
> 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@aepfle.de>
>
> ---
>   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" )

Isn't this incorrect in case ${file} contains a character that is a 
regex escape (e.g. a star or backslash)?

Paolo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hotplug: allow hardlinked files for block device images
  2011-01-17 15:48 ` Paolo Bonzini
@ 2011-01-17 15:57   ` Olaf Hering
  2011-01-17 15:58     ` Paolo Bonzini
  0 siblings, 1 reply; 8+ messages in thread
From: Olaf Hering @ 2011-01-17 15:57 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: xen-devel, Stefano Stabellini

On Mon, Jan 17, Paolo Bonzini wrote:

> Isn't this incorrect in case ${file} contains a character that is a
> regex escape (e.g. a star or backslash)?

I'm sure there are pathnames which break the regex in some way.
Adding an escape for '@' could be added, for example.

How well can the rest of Xen cope with odd filenames? In other words,
does it even get there if the configured pathnames have odd chars in it?

Olaf

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hotplug: allow hardlinked files for block device images
  2011-01-17 15:57   ` Olaf Hering
@ 2011-01-17 15:58     ` Paolo Bonzini
  2011-01-17 18:07       ` [PATCH] hotplug: allow hardlinked files for block device images [and 1 more messages] Ian Jackson
  0 siblings, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2011-01-17 15:58 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel, Stefano Stabellini

On 01/17/2011 04:57 PM, Olaf Hering wrote:
> I'm sure there are pathnames which break the regex in some way.
> Adding an escape for '@' could be added, for example.
>
> How well can the rest of Xen cope with odd filenames? In other words,
> does it even get there if the configured pathnames have odd chars in it?

@ is definitely not so odd...

Paolo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hotplug: allow hardlinked files for block device images [and 1 more messages]
  2011-01-17 15:58     ` Paolo Bonzini
@ 2011-01-17 18:07       ` Ian Jackson
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Jackson @ 2011-01-17 18:07 UTC (permalink / raw)
  To: Paolo Bonzini, Olaf Hering; +Cc: xen-devel, Stefano Stabellini

Olaf Hering writes ("[Xen-devel] [PATCH] hotplug: allow hardlinked files for block device images"):
> Without this change, $dev would contain /dev/loop8\n/dev/loop10
> Applies to 4.0 and 4.1

Thanks.  I have applied this to xen-unstable.hg.  I'm always a bit suspicious
of hotplug script changes, so we'll wait with backporting it to see if
it doesn't cause immediate trouble ...

Paolo Bonzini writes ("[Xen-devel] Re: [PATCH] hotplug: allow hardlinked files for block device images"):
> On 01/17/2011 04:57 PM, Olaf Hering wrote:
> > I'm sure there are pathnames which break the regex in some way.
> > Adding an escape for '@' could be added, for example.
> >
> > How well can the rest of Xen cope with odd filenames? In other words,
> > does it even get there if the configured pathnames have odd chars in it?
> 
> @ is definitely not so odd...

Yes, this is a good point.  However, I think the patch as it stands is
an improvement.  Feel free to submit changes to make it more robust
:-).

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-01-17 18:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-26 13:55 [PATCH] hotplug: allow hardlinked files for block device images Olaf Hering
2011-01-16 14:43 ` Olaf Hering
2011-01-16 15:14   ` Keir Fraser
2011-01-17 10:59 ` Stefano Stabellini
2011-01-17 15:48 ` Paolo Bonzini
2011-01-17 15:57   ` Olaf Hering
2011-01-17 15:58     ` Paolo Bonzini
2011-01-17 18:07       ` [PATCH] hotplug: allow hardlinked files for block device images [and 1 more messages] Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.