blktap2: set corret file path for all drivers in chain.
PATCH 1/1 blktap2: set corret file path for all drivers in chain.
In this example: tap-ctl create -a "log:|aio:/mnt/images/debian.img" driver 'log' gets empty string as a file path and can't create correct unix socket in /var/run/tap.
Now every driver gets correct file path.
Signed-off-by Lukasz Oles <[email protected]>
tools/blktap2/drivers/tapdisk-disktype.c Tue Aug 17 22:50:18 2010 +0000 renamed from tools/blktap2/drivers/tapdisk-disktype.c Tue Aug 17 21:19:05 2010 +0000 +7 -1
@@ -184,7 +184,13 @@ type = tapdisk_disktype_find(name); if (type >= 0) - *_path = params + len + 1; + { + *_path = strrchr(params + len + 2, ':'); + if (*_path) + *_path = *_path + 1; + else + *_path = params + len + 1; + } return type; }