[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging-4.19] hotplug: Restore block-tap phy compatibility (again)



commit 2d7b6170cc69f8a1a60c52d87ba61f6b1f180132
Author:     Jason Andryuk <jason.andryuk@xxxxxxx>
AuthorDate: Wed Jul 24 11:53:04 2024 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jul 24 11:53:04 2024 +0200

    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 <jason.andryuk@xxxxxxx>
    Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
    master commit: e4c7c2148afd5a02c36193c79e8ab62c86c5f0b0
    master date: 2024-07-24 11:36:04 +0200
---
 tools/hotplug/Linux/block-tap | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.