hotplug: Restore block-tap phy compatibility (again)

"$dev" needs to be set correctly for backendtype=phy as well as
backendtype=tap.  Move the setting into the conditional, so it can be
handled properly for each.

(dev could be captured during tap-ctl allocate for blktap module, but it
would not be set properly for the find_device case.  The backendtype=tap
case would need to be handled regardless.)

Fixes: f16ac12bd4 ("hotplug: Restore block-tap phy compatibility")
Fixes: 76a484193d ("hotplug: Update block-tap")
Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
master commit: e4c7c2148a
master date: 2024-07-24 11:36:04 +0200
This commit is contained in:
Jason Andryuk authored and Jan Beulich committed 2024-07-24 11:53:04 +02:00
1 parent 9d7f7e3444
commit 2d7b6170cc
1 file changed
+6 -3
+6 -3
View File
@@ -204,13 +204,13 @@ add()
tap_create
fi
# Create nbd unix path. find_device/tap_create set pid & minor
dev=$( printf "/run/blktap-control/nbd%ld.%d" "$pid" "$minor" )
xenstore_write "$XENBUS_PATH/pid" "$pid"
xenstore_write "$XENBUS_PATH/minor" "$minor"
if [ "$XENBUS_TYPE" = "vbd3" ] ; then
# Create nbd unix path. find_device/tap_create set pid & minor
dev=$( printf "/run/blktap-control/nbd%ld.%d" "$pid" "$minor" )
# $dev, as a unix socket, has major:minor 0:0. If write_dev writes
# physical-device, tapback would use that incorrect minor 0. So don't
# write physical-device.
@@ -218,6 +218,9 @@ add()
success
else
# Construct dev path from minor
dev="/dev/xen/blktap-2/tapdev$minor"
[ -b "$dev" ] || fatal "blktap \"$dev\" is not a block dev"
write_dev "$dev"
fi
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.