Skip to contentSkip to conversation

tools/hotplug/Linux/blktap: remove optional tapdisk: prefix

PATCH In review Jan Beulich 2 participants 4 messages Apr 16, 2010 – Apr 20, 2010 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/hotplug/Linux/blktap: remove optional tapdisk: prefix

Perhaps this should even be further generalized (e.g. to remove any "[!/]*:" pattern prefixes) to be more forward compatible?

tools/hotplug/Linux/blktap +1 -0
@@ -59,6 +59,7 @@
 if [ -n "$t" ]
 then
     p=$(xenstore_read "$XENBUS_PATH/params")
+    p=${p#tapdisk:}
     # if we have a ':', chew from head including :
     if echo $p | grep -q \:
     then

Perhaps this should even be further generalized (e.g. to remove any "[!/]*:" pattern prefixes) to be more forward compatible?

tools/hotplug/Linux/blktap +1 -0
@@ -59,6 +59,7 @@
 if [ -n "$t" ]
 then
     p=$(xenstore_read "$XENBUS_PATH/params")
+    p=${p#tapdisk:}
     # if we have a ':', chew from head including :
     if echo $p | grep -q \:
     then

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 3 lines · Jan Beulich

Perhaps this should even be further generalized (e.g. to remove any "[!/]*:" pattern prefixes) to be more forward compatible?

Right. Need to handle the 'ioemu' subtype as well. How about just stripping of everything before the leading '/'? E.g. like the attached patch?

Regards,
Jim

tools/hotplug/Linux/blktap +2 -2
diff -r c02cc832cb2d tools/hotplug/Linux/blktap
@@ -59,10 +59,10 @@
 if [ -n "$t" ]
 then
     p=$(xenstore_read "$XENBUS_PATH/params")
-    # if we have a ':', chew from head including :
+    # if we have a ':', remove everything up to leading '/'
     if echo $p | grep -q \:
     then
-        p=${p#*:}
+        p="/${p#*/}"
     fi
 fi
 # some versions of readlink cannot be passed a regular file

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line

Jim Fehlig <[email protected]> 16.04.10 22:51 >>>

Quoted 3 lines · Jan Beulich

Perhaps this should even be further generalized (e.g. to remove any "[!/]*:" pattern prefixes) to be more forward compatible?

Right. Need to handle the 'ioemu' subtype as well. How about just stripping of everything before the leading '/'? E.g. like the attached patch?

Wouldn't that become wrong when remote locations are acceptable here (not sure if they aren't already), i.e. server:/path/file? If that is not expected to ever have a meaning and if relative paths aren't permitted here, then yes, that would of course be the best solution.

Jan

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 8 lines · Jan Beulich
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

Jim Fehlig <[email protected]> 16.04.10 22:51 >>>

Quoted 4 lines · Jan Beulich

Perhaps this should even be further generalized (e.g. to remove any "[!/]*:" pattern prefixes) to be more forward compatible?

Quoted 7 lines
Quoted 4 lines

Right. Need to handle the 'ioemu' subtype as well. How about just stripping of everything before the leading '/'? E.g. like the attached patch?

Wouldn't that become wrong when remote locations are acceptable here (not sure if they aren't already), i.e. server:/path/file?

IMO, remote locations should be handled by another tap driver optimized for the remote file protocol, similar to the nbd, curl, etc. block backends in qemu.

Quoted 4 lines

If that
is not expected to ever have a meaning and if relative paths aren't permitted here, then yes, that would of course be the best solution.

The tools currently don't cope with relative paths in disk specification.

Jim