Blame SOURCES/bz1932863-VirtualDomain-fix-pid-status.patch

27b8ba
From 500de79739cd39808fb48fa556c9b9b9fe2e8acd Mon Sep 17 00:00:00 2001
27b8ba
From: Matthias Hensler <matthias@wspse.de>
27b8ba
Date: Thu, 18 Feb 2021 12:49:49 +0100
27b8ba
Subject: [PATCH] fix pid_status() for VirtualDomain on EL8
27b8ba
27b8ba
see https://github.com/ClusterLabs/resource-agents/issues/1613
27b8ba
---
27b8ba
 heartbeat/VirtualDomain | 4 ++--
27b8ba
 1 file changed, 2 insertions(+), 2 deletions(-)
27b8ba
27b8ba
diff --git a/heartbeat/VirtualDomain b/heartbeat/VirtualDomain
27b8ba
index eb41e3e22..f9cd21fc7 100755
27b8ba
--- a/heartbeat/VirtualDomain
27b8ba
+++ b/heartbeat/VirtualDomain
27b8ba
@@ -421,14 +421,14 @@ pid_status()
27b8ba
 	case "$emulator" in
27b8ba
 		qemu-kvm|qemu-dm|qemu-system-*)
27b8ba
 			rc=$OCF_NOT_RUNNING
27b8ba
-			ps awx | grep -E "[q]emu-(kvm|dm|system).*-name $DOMAIN_NAME " > /dev/null 2>&1
27b8ba
+			ps awx | grep -E "[q]emu-(kvm|dm|system).*-name ($DOMAIN_NAME|[^ ]*guest=$DOMAIN_NAME(,[^ ]*)?) " > /dev/null 2>&1
27b8ba
 			if [ $? -eq 0 ]; then
27b8ba
 				rc=$OCF_SUCCESS
27b8ba
 			fi
27b8ba
 			;;
27b8ba
 		libvirt_lxc)
27b8ba
 			rc=$OCF_NOT_RUNNING
27b8ba
-			ps awx | grep -E "[l]ibvirt_lxc.*-name $DOMAIN_NAME " > /dev/null 2>&1
27b8ba
+			ps awx | grep -E "[l]ibvirt_lxc.*-name ($DOMAIN_NAME|[^ ]*guest=$DOMAIN_NAME(,[^ ]*)?) " > /dev/null 2>&1
27b8ba
 			if [ $? -eq 0 ]; then
27b8ba
 				rc=$OCF_SUCCESS
27b8ba
 			fi