All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Liu <john.liuli@huawei.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] qemu-char: fix terminal crash when using "-monitor stdio -nographic"
Date: Fri, 5 Sep 2014 09:38:58 +0800	[thread overview]
Message-ID: <54091432.4050904@huawei.com> (raw)
In-Reply-To: <53FD8B7D.7030301@huawei.com>

Ping, any more comments? Thanks.

On 2014/8/27 15:40, Li Liu wrote:
> 
> 
> On 2014/8/27 14:44, Markus Armbruster wrote:
>> "john.liuli" <john.liuli@huawei.com> writes:
>>
>>> From: Li Liu <john.liuli@huawei.com>
>>>
>>> Eeay to reproduce, just try "qemu -monitor stdio -nographic"
>>> and type "quit", then the terminal will be crashed.
>>>
>>> There are two pathes try to call tcgetattr of stdio in vl.c:
>>>
>>> 1) Monitor_parse(optarg, "readline");
>>>    .....
>>>    qemu_opts_foreach(qemu_find_opts("chardev"),
>>>                      chardev_init_func, NULL, 1) != 0)
>>>
>>> 2) if (default_serial)
>>>    add_device_config(DEV_SERIAL, "stdio");
>>>    ....
>>>    if (foreach_device_config(DEV_SERIAL, serial_parse) < 0)
>>>
>>> Both of them will trigger qemu_chr_open_stdio which will disable
>>> ECHO attributes. First one has updated the attributes of stdio
>>> by calling qemu_chr_fe_set_echo(chr, false). And the tty
>>> attributes has been saved in oldtty. Then the second path will
>>> redo such actions, and the oldtty is overlapped. So till "quit",
>>> term_exit can't recove the correct attributes.
>>>
>>> Signed-off-by: Li Liu <john.liuli@huawei.com>
>>
>> Yes, failure to restore tty settings is a bug.
>>
>> But is having multiple character devices use the same terminal valid?
> 
> I'm not sure. But I have found such comments in vl.c
> "According to documentation and historically, -nographic redirects
> serial port, parallel port and monitor to stdio"
> 
> Best regards
> Li.
> 
>> If no, can we catch and reject the attempt?
>>
>> [...]
>>
>>
> 
> 
> 
> 



WARNING: multiple messages have this Message-ID (diff)
From: Li Liu <john.liuli@huawei.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-char: fix terminal crash when using "-monitor stdio -nographic"
Date: Fri, 5 Sep 2014 09:38:58 +0800	[thread overview]
Message-ID: <54091432.4050904@huawei.com> (raw)
In-Reply-To: <53FD8B7D.7030301@huawei.com>

Ping, any more comments? Thanks.

On 2014/8/27 15:40, Li Liu wrote:
> 
> 
> On 2014/8/27 14:44, Markus Armbruster wrote:
>> "john.liuli" <john.liuli@huawei.com> writes:
>>
>>> From: Li Liu <john.liuli@huawei.com>
>>>
>>> Eeay to reproduce, just try "qemu -monitor stdio -nographic"
>>> and type "quit", then the terminal will be crashed.
>>>
>>> There are two pathes try to call tcgetattr of stdio in vl.c:
>>>
>>> 1) Monitor_parse(optarg, "readline");
>>>    .....
>>>    qemu_opts_foreach(qemu_find_opts("chardev"),
>>>                      chardev_init_func, NULL, 1) != 0)
>>>
>>> 2) if (default_serial)
>>>    add_device_config(DEV_SERIAL, "stdio");
>>>    ....
>>>    if (foreach_device_config(DEV_SERIAL, serial_parse) < 0)
>>>
>>> Both of them will trigger qemu_chr_open_stdio which will disable
>>> ECHO attributes. First one has updated the attributes of stdio
>>> by calling qemu_chr_fe_set_echo(chr, false). And the tty
>>> attributes has been saved in oldtty. Then the second path will
>>> redo such actions, and the oldtty is overlapped. So till "quit",
>>> term_exit can't recove the correct attributes.
>>>
>>> Signed-off-by: Li Liu <john.liuli@huawei.com>
>>
>> Yes, failure to restore tty settings is a bug.
>>
>> But is having multiple character devices use the same terminal valid?
> 
> I'm not sure. But I have found such comments in vl.c
> "According to documentation and historically, -nographic redirects
> serial port, parallel port and monitor to stdio"
> 
> Best regards
> Li.
> 
>> If no, can we catch and reject the attempt?
>>
>> [...]
>>
>>
> 
> 
> 
> 

  reply	other threads:[~2014-09-05  1:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27  5:00 [Qemu-devel] [PATCH] qemu-char: fix terminal crash when using "-monitor stdio -nographic" john.liuli
2014-08-27  6:44 ` Markus Armbruster
2014-08-27  7:40   ` Li Liu
2014-09-05  1:38     ` Li Liu [this message]
2014-09-05  1:38       ` Li Liu
2014-09-05  9:04       ` [Qemu-trivial] " Markus Armbruster
2014-09-05  9:04         ` Markus Armbruster
2014-09-05  9:31         ` [Qemu-trivial] " Gerd Hoffmann
2014-09-05  9:31           ` Gerd Hoffmann
2014-09-09  2:22           ` [Qemu-trivial] " Li Liu
2014-09-09  2:22             ` Li Liu

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=54091432.4050904@huawei.com \
    --to=john.liuli@huawei.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.