public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH v1] arch-run: migration: properly handle crashing outgoing QEMU
@ 2023-09-26 12:08 Nico Boehr
  2023-10-09 11:29 ` Thomas Huth
  0 siblings, 1 reply; 4+ messages in thread
From: Nico Boehr @ 2023-09-26 12:08 UTC (permalink / raw)
  To: frankja, imbrenda, thuth, pbonzini, andrew.jones; +Cc: kvm, linux-s390

When outgoing (live) QEMU crashes or times out during migration, we
currently hang forever.

This is because we don't exit the loop querying migration state when QMP
communication fails.

Add proper error handling to the loop and exit when QMP communication
fails for whatever reason.

Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
---
Sorry I accidentally sent this only to s390x maintainers and forgot
Paolo and Andrew, hence resending.

 scripts/arch-run.bash | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 518607f4b75d..de9890408e24 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -162,8 +162,14 @@ run_migration ()
 	migstatus=`qmp ${qmp1} '"query-migrate"' | grep return`
 	while ! grep -q '"completed"' <<<"$migstatus" ; do
 		sleep 1
-		migstatus=`qmp ${qmp1} '"query-migrate"' | grep return`
-		if grep -q '"failed"' <<<"$migstatus" ; then
+		if ! migstatus=`qmp ${qmp1} '"query-migrate"'`; then
+			echo "ERROR: Querying migration state failed." >&2
+			echo > ${fifo}
+			qmp ${qmp2} '"quit"'> ${qmpout2} 2>/dev/null
+			return 2
+		fi
+		migstatus=`grep return <<<"$migstatus"`
+		if grep -q '"failed"' <<<"$migstatus"; then
 			echo "ERROR: Migration failed." >&2
 			echo > ${fifo}
 			qmp ${qmp1} '"quit"'> ${qmpout1} 2>/dev/null
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [kvm-unit-tests PATCH v1] arch-run: migration: properly handle crashing outgoing QEMU
@ 2023-09-26 11:18 Nico Boehr
  0 siblings, 0 replies; 4+ messages in thread
From: Nico Boehr @ 2023-09-26 11:18 UTC (permalink / raw)
  To: frankja, imbrenda, thuth; +Cc: kvm, linux-s390

When outgoing (live) QEMU crashes or times out during migration, we
currently hang forever.

This is because we don't exit the loop querying migration state when QMP
communication fails.

Add proper error handling to the loop and exit when QMP communication
fails for whatever reason.

Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
---
 scripts/arch-run.bash | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 518607f4b75d..de9890408e24 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -162,8 +162,14 @@ run_migration ()
 	migstatus=`qmp ${qmp1} '"query-migrate"' | grep return`
 	while ! grep -q '"completed"' <<<"$migstatus" ; do
 		sleep 1
-		migstatus=`qmp ${qmp1} '"query-migrate"' | grep return`
-		if grep -q '"failed"' <<<"$migstatus" ; then
+		if ! migstatus=`qmp ${qmp1} '"query-migrate"'`; then
+			echo "ERROR: Querying migration state failed." >&2
+			echo > ${fifo}
+			qmp ${qmp2} '"quit"'> ${qmpout2} 2>/dev/null
+			return 2
+		fi
+		migstatus=`grep return <<<"$migstatus"`
+		if grep -q '"failed"' <<<"$migstatus"; then
 			echo "ERROR: Migration failed." >&2
 			echo > ${fifo}
 			qmp ${qmp1} '"quit"'> ${qmpout1} 2>/dev/null
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-09 14:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-26 12:08 [kvm-unit-tests PATCH v1] arch-run: migration: properly handle crashing outgoing QEMU Nico Boehr
2023-10-09 11:29 ` Thomas Huth
2023-10-09 14:33   ` Nico Boehr
  -- strict thread matches above, loose matches on Subject: below --
2023-09-26 11:18 Nico Boehr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox