From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Thomas Huth" <thuth@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
linux-s390@vger.kernel.org, Nico Boehr <nrb@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
kvm@vger.kernel.org, David Hildenbrand <david@redhat.com>,
linuxppc-dev@lists.ozlabs.org,
Shaoqin Huang <shahuang@redhat.com>,
Andrew Jones <andrew.jones@linux.dev>,
Eric Auger <eric.auger@redhat.com>,
Marc Hartmayer <mhartmay@linux.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>
Subject: Re: [kvm-unit-tests PATCH 1/7] arch-run: Keep infifo open
Date: Tue, 05 Mar 2024 12:21:05 +1000 [thread overview]
Message-ID: <CZLGHKHQ3FF0.2H7R39AIIFDY@wheely> (raw)
In-Reply-To: <e802a3a4-5ab7-447f-b09b-75d710ba7bd6@redhat.com>
On Fri Mar 1, 2024 at 11:32 PM AEST, Thomas Huth wrote:
> 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 :-)
It was a bit of a stretch, but I'm glad you liked it :) I may
incorporate your suggestion to improve it.
>
> > 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:
Yep, deleted by trap handler.
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
Thanks,
Nick
next prev parent reply other threads:[~2024-03-05 2:21 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
2024-03-05 2:21 ` Nicholas Piggin [this message]
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=CZLGHKHQ3FF0.2H7R39AIIFDY@wheely \
--to=npiggin@gmail.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=nrb@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=shahuang@redhat.com \
--cc=thuth@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;
as well as URLs for NNTP newsgroup(s).