From: Thomas Huth <thuth@redhat.com>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: kvm@vger.kernel.org, Laurent Vivier <lvivier@redhat.com>,
Shaoqin Huang <shahuang@redhat.com>,
Andrew Jones <andrew.jones@linux.dev>,
Nico Boehr <nrb@linux.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Eric Auger <eric.auger@redhat.com>,
Janosch Frank <frankja@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
David Hildenbrand <david@redhat.com>,
Marc Hartmayer <mhartmay@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH 1/7] arch-run: Keep infifo open
Date: Fri, 1 Mar 2024 14:32:53 +0100 [thread overview]
Message-ID: <e802a3a4-5ab7-447f-b09b-75d710ba7bd6@redhat.com> (raw)
In-Reply-To: <20240226093832.1468383-2-npiggin@gmail.com>
On 26/02/2024 10.38, Nicholas Piggin wrote:
> The infifo fifo that is used to send characters to QEMU console is
> only able to receive one character before the cat process exits.
> Supporting interactions between test and harness involving multiple
> characters requires the fifo to remain open.
>
> This also allows us to let the cat out of the bag, simplifying the
> input pipeline.
LOL, we rather let the cat out of the subshell now, but I like the play on
words :-)
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> scripts/arch-run.bash | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
> index 6daef3218..e5b36a07b 100644
> --- a/scripts/arch-run.bash
> +++ b/scripts/arch-run.bash
> @@ -158,6 +158,11 @@ run_migration ()
> mkfifo ${src_outfifo}
> mkfifo ${dst_outfifo}
>
> + # Holding both ends of the input fifo open prevents opens from
> + # blocking and readers getting EOF when a writer closes it.
> + mkfifo ${dst_infifo}
> + exec {dst_infifo_fd}<>${dst_infifo}
> +
> eval "$migcmdline" \
> -chardev socket,id=mon,path=${src_qmp},server=on,wait=off \
> -mon chardev=mon,mode=control > ${src_outfifo} &
> @@ -191,14 +196,10 @@ run_migration ()
>
> do_migration ()
> {
> - # We have to use cat to open the named FIFO, because named FIFO's,
> - # unlike pipes, will block on open() until the other end is also
> - # opened, and that totally breaks QEMU...
> - mkfifo ${dst_infifo}
> eval "$migcmdline" \
> -chardev socket,id=mon,path=${dst_qmp},server=on,wait=off \
> -mon chardev=mon,mode=control -incoming unix:${dst_incoming} \
> - < <(cat ${dst_infifo}) > ${dst_outfifo} &
> + < ${dst_infifo} > ${dst_outfifo} &
> incoming_pid=$!
> cat ${dst_outfifo} | tee ${dst_out} | filter_quiet_msgs &
>
> @@ -245,7 +246,6 @@ do_migration ()
>
> # keypress to dst so getchar completes and test continues
> echo > ${dst_infifo}
> - rm ${dst_infifo}
I assume it will not get deleted by the trap handler? ... sounds fine to me,
so I dare to say:
Reviewed-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2024-03-01 13:33 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-26 9:38 [kvm-unit-tests PATCH 0/7] more migration enhancements and tests Nicholas Piggin
2024-02-26 9:38 ` [kvm-unit-tests PATCH 1/7] arch-run: Keep infifo open Nicholas Piggin
2024-03-01 13:32 ` Thomas Huth [this message]
2024-03-05 2:21 ` Nicholas Piggin
2024-02-26 9:38 ` [kvm-unit-tests PATCH 2/7] migration: Add a migrate_skip command Nicholas Piggin
2024-03-04 6:05 ` Thomas Huth
2024-02-26 9:38 ` [kvm-unit-tests PATCH 3/7] (arm|s390): Use migrate_skip in test cases Nicholas Piggin
2024-03-01 13:49 ` Thomas Huth
2024-02-26 9:38 ` [kvm-unit-tests PATCH 4/7] powerpc: add asm/time.h header with delay and get_clock_us/ms Nicholas Piggin
2024-03-01 14:05 ` Thomas Huth
2024-02-26 9:38 ` [kvm-unit-tests PATCH 5/7] arch-run: Add a "continuous" migration option for tests Nicholas Piggin
2024-03-04 6:17 ` Thomas Huth
2024-03-04 9:19 ` Andrew Jones
2024-03-05 2:58 ` Nicholas Piggin
2024-03-05 2:47 ` Nicholas Piggin
2024-02-26 9:38 ` [kvm-unit-tests PATCH 6/7] gitlab-ci: Run migration selftest on s390x and powerpc Nicholas Piggin
2024-03-01 14:16 ` Thomas Huth
2024-03-05 2:38 ` Nicholas Piggin
2024-03-05 6:50 ` Thomas Huth
2024-02-26 9:38 ` [kvm-unit-tests PATCH 7/7] common: add memory dirtying vs migration test Nicholas Piggin
2024-03-04 6:22 ` Thomas Huth
2024-03-05 2:50 ` Nicholas Piggin
2024-03-05 6:52 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e802a3a4-5ab7-447f-b09b-75d710ba7bd6@redhat.com \
--to=thuth@redhat.com \
--cc=alexandru.elisei@arm.com \
--cc=andrew.jones@linux.dev \
--cc=david@redhat.com \
--cc=eric.auger@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lvivier@redhat.com \
--cc=mhartmay@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=nrb@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=shahuang@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox