qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/5] iotests: make meson aware of individual I/O tests


From: Thomas Huth
Subject: Re: [PATCH 0/5] iotests: make meson aware of individual I/O tests
Date: Fri, 3 Mar 2023 16:49:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 03/03/2023 14.06, Daniel P. Berrangé wrote:
On Fri, Mar 03, 2023 at 10:45:40AM +0000, Daniel P. Berrangé wrote:
On Fri, Mar 03, 2023 at 09:30:39AM +0100, Thomas Huth wrote:
On 02/03/2023 19.46, Daniel P. Berrangé wrote:
3) When I tried this last year, I had a weird problem that
    the terminal sometimes gets messed up ... I wasn't able
    to track it down back then - could you check by running
    "make check-block" many times (>10 times) to see whether
    it happens with your series or not?

I've just seen this - echo got disabled on my terminal.

The problem is that testrunner.py script doing

# We want to save current tty settings during test run,
# since an aborting qemu call may leave things screwed up.
@contextmanager
def savetty() -> Iterator[None]:
     isterm = sys.stdin.isatty()
     if isterm:
         fd = sys.stdin.fileno()
         attr = termios.tcgetattr(fd)

     try:
         yield
     finally:
         if isterm:
             termios.tcsetattr(fd, termios.TCSADRAIN, attr)


When invoking 'check' this wraps around execution of the entire
'check' script. IOW it saves/restores the terminal once.

When we invoke 'check' in parallel it will save/restore the same
terminal for each invokation.

If the 'termios.tcgetattr' call runs at the same time as there is
a QEMU running which has put the terminal in raw mode, then when
'check' exits it'll "restore" the terminal to raw mode.

IOW, this savetty() logic is fundamentally unsafe when invoking
'check' in parallel.

Hmm, couldn't we e.g. also simply skip this termios stuff when running with "--tap" ?

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]