From 581a45f2a538110086a7d467d3e53a2a504e2aa4 Mon Sep 17 00:00:00 2001 From: Mario Preksavec Date: Wed, 25 Feb 2015 12:08:00 +0100 Subject: system/drbd-utils: Fix for Xen physical device paths. --- system/drbd-utils/drbd-utils.SlackBuild | 8 +++++-- .../patches/xen_handle_physical_device_paths.diff | 25 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 system/drbd-utils/patches/xen_handle_physical_device_paths.diff (limited to 'system/drbd-utils') diff --git a/system/drbd-utils/drbd-utils.SlackBuild b/system/drbd-utils/drbd-utils.SlackBuild index 7596695cbd..f5a3364b8d 100644 --- a/system/drbd-utils/drbd-utils.SlackBuild +++ b/system/drbd-utils/drbd-utils.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for drbd-utils -# Copyright 2014 Mario Preksavec, Zagreb, HR +# Copyright 2014, 2015 Mario Preksavec, Zagreb, Croatia # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,7 +24,7 @@ PRGNAM=drbd-utils VERSION=${VERSION:-8.9.1} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -69,6 +69,10 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +# This patch allows resources with path: drbd:/dev/drbd/by-res/ +# Xen HVM domains will be able to live migrate with qemu-xen-traditional +patch -p1 <$CWD/patches/xen_handle_physical_device_paths.diff + CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ diff --git a/system/drbd-utils/patches/xen_handle_physical_device_paths.diff b/system/drbd-utils/patches/xen_handle_physical_device_paths.diff new file mode 100644 index 0000000000..dd36a4af57 --- /dev/null +++ b/system/drbd-utils/patches/xen_handle_physical_device_paths.diff @@ -0,0 +1,25 @@ +--- drbd-utils-8.9.1/scripts/block-drbd.orig 2014-07-04 14:23:23.000000000 +0200 ++++ drbd-utils-8.9.1/scripts/block-drbd 2015-02-16 02:50:39.257522006 +0100 +@@ -251,6 +251,7 @@ + + case $t in + drbd|phy) ++ p=${p/*dev*drbd*by-res\/} # Clean physical device paths + drbd_resource=$p + drbd_role="$(drbdadm role $drbd_resource)" + drbd_lrole="${drbd_role%%/*}" +@@ -280,12 +281,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_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 -- cgit v1.2.3