From: Jason Andryuk Date: Wed, 24 Jul 2024 09:36:04 +0000 (+0200) Subject: hotplug: Restore block-tap phy compatibility (again) X-Git-Tag: 4.20.0-rc1~731 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e4c7c2148afd5a02c36193c79e8ab62c86c5f0b0;p=xen.git 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: f16ac12bd418 ("hotplug: Restore block-tap phy compatibility") Fixes: 76a484193dbb ("hotplug: Update block-tap") Signed-off-by: Jason Andryuk Reviewed-by: Anthony PERARD --- diff --git a/tools/hotplug/Linux/block-tap b/tools/hotplug/Linux/block-tap index 8661ce77e3..95970a61f6 100755 --- a/tools/hotplug/Linux/block-tap +++ b/tools/hotplug/Linux/block-tap @@ -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