slackbuilds_ponce/system/drbd-utils/patches/xen_handle_physical_device_paths.diff
Mario Preksavec 07efe8658c system/drbd-utils: Updated for version 9.1.0.
Signed-off-by: Mario Preksavec <mario@slackware.hr>
2017-09-30 07:19:35 +07:00

25 lines
922 B
Diff

--- drbd-utils-9.1.0/scripts/block-drbd.orig 2017-08-31 14:25:29.000000000 +0200
+++ drbd-utils-9.1.0/scripts/block-drbd 2017-09-22 21:25:51.309873782 +0200
@@ -249,6 +249,7 @@
if [ -n "$t" ]
then
p=$(xenstore_read "$XENBUS_PATH/params")
+ p=${p/*dev*drbd*by-res\/} # Clean physical device paths
p=${p#drbd:}
mode=$(xenstore_read "$XENBUS_PATH/mode")
fi
@@ -284,12 +285,14 @@
case $t in
drbd|phy)
p=$(xenstore_read "$XENBUS_PATH/params")
+ p=${p/*dev*drbd*by-res\/} # Clean physical device paths
drbd_resource=${p#drbd:}
drbd_role="$(drbdadm role $drbd_resource)"
drbd_lrole="${drbd_role%%/*}"
drbd_dev="$(drbdadm sh-dev $drbd_resource)"
if [ "$drbd_lrole" != 'Secondary' ]; then
+ sleep 1 # Sleep for a second just in case
drbdadm secondary $drbd_resource
fi
exit 0