qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Strange monitor/stdout issue on qemu-system-sparc/qemu-system-ppc
@ 2016-01-31 15:19 Mark Cave-Ayland
  2016-01-31 15:34 ` Peter Maydell
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Cave-Ayland @ 2016-01-31 15:19 UTC (permalink / raw)
  To: qemu-devel

Hi Daniel,

Commit d0d7708ba29cbcc343364a46bff981e0ff88366f "qemu-char: add logfile
facility to all chardev backends" appears to be causing problems with
the monitor and stdin/stdout on both qemu-system-sparc/qemu-system-ppc here.

On current git master I see the following behaviour changes when
launching qemu-system-ppc/qemu-system-sparc directly from the command
line with no parameters:

- Serial port output is now also written to stdout

- The monitor output also appears on stdout by default, rather than
being enabled with CTRL-A-c. However if I enter this sequence manually
on stdin then I am unable to enter or interact with the monitor.

- If I use the gtk interface to switch to the monitor terminal and
attempt to type, I get multiple copies of each letter echoed back in the
graphical terminal

Are there other changes that need to be made to these targets in order
for the functionality to work as before?


Many thanks,

Mark.

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

* Re: [Qemu-devel] Strange monitor/stdout issue on qemu-system-sparc/qemu-system-ppc
  2016-01-31 15:19 [Qemu-devel] Strange monitor/stdout issue on qemu-system-sparc/qemu-system-ppc Mark Cave-Ayland
@ 2016-01-31 15:34 ` Peter Maydell
  2016-01-31 15:54   ` Mark Cave-Ayland
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2016-01-31 15:34 UTC (permalink / raw)
  To: Mark Cave-Ayland; +Cc: qemu-devel

On 31 January 2016 at 15:19, Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
> Hi Daniel,
>
> Commit d0d7708ba29cbcc343364a46bff981e0ff88366f "qemu-char: add logfile
> facility to all chardev backends" appears to be causing problems with
> the monitor and stdin/stdout on both qemu-system-sparc/qemu-system-ppc here.

These should be fixed by https://patchwork.ozlabs.org/patch/571128/
I think (the duplicate output at least; the multiple-echoback I'm
not so sure about).

thanks
-- PMM

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

* Re: [Qemu-devel] Strange monitor/stdout issue on qemu-system-sparc/qemu-system-ppc
  2016-01-31 15:34 ` Peter Maydell
@ 2016-01-31 15:54   ` Mark Cave-Ayland
  2016-01-31 17:19     ` Paolo Bonzini
  2016-02-08  9:08     ` Paolo Bonzini
  0 siblings, 2 replies; 9+ messages in thread
From: Mark Cave-Ayland @ 2016-01-31 15:54 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

On 31/01/16 15:34, Peter Maydell wrote:

> On 31 January 2016 at 15:19, Mark Cave-Ayland
> <mark.cave-ayland@ilande.co.uk> wrote:
>> Hi Daniel,
>>
>> Commit d0d7708ba29cbcc343364a46bff981e0ff88366f "qemu-char: add logfile
>> facility to all chardev backends" appears to be causing problems with
>> the monitor and stdin/stdout on both qemu-system-sparc/qemu-system-ppc here.
> 
> These should be fixed by https://patchwork.ozlabs.org/patch/571128/
> I think (the duplicate output at least; the multiple-echoback I'm
> not so sure about).

Aha! A quick test here shows that the patch fixes the serial port
appearing on stdout and entering the monitor, but I still see the
multiple echo problem in the GTK GUI.

I also notice that with the above commit I lose cycling through history
in the GTK monitor - even with the multiple echo, instead of the up/down
arrow keys cycling through the history instead I see the codes ^[[B and
^[[A being output to the window instead.


ATB,

Mark.

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

* Re: [Qemu-devel] Strange monitor/stdout issue on qemu-system-sparc/qemu-system-ppc
  2016-01-31 15:54   ` Mark Cave-Ayland
@ 2016-01-31 17:19     ` Paolo Bonzini
  2016-01-31 17:54       ` Peter Maydell
  2016-02-08  9:08     ` Paolo Bonzini
  1 sibling, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2016-01-31 17:19 UTC (permalink / raw)
  To: Mark Cave-Ayland, Peter Maydell; +Cc: qemu-devel



On 31/01/2016 16:54, Mark Cave-Ayland wrote:
> Aha! A quick test here shows that the patch fixes the serial port
> appearing on stdout and entering the monitor, but I still see the
> multiple echo problem in the GTK GUI.
> 
> I also notice that with the above commit I lose cycling through history
> in the GTK monitor - even with the multiple echo, instead of the up/down
> arrow keys cycling through the history instead I see the codes ^[[B and
> ^[[A being output to the window instead.

That is probably me.  The echo feature was introduced for QMP, but in
theory it should have been limited to that.  I'll check it, thanks.

Paolo

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

* Re: [Qemu-devel] Strange monitor/stdout issue on qemu-system-sparc/qemu-system-ppc
  2016-01-31 17:19     ` Paolo Bonzini
@ 2016-01-31 17:54       ` Peter Maydell
  2016-01-31 21:57         ` Paolo Bonzini
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2016-01-31 17:54 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Mark Cave-Ayland, qemu-devel

On 31 January 2016 at 17:19, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 31/01/2016 16:54, Mark Cave-Ayland wrote:
>> I also notice that with the above commit I lose cycling through history
>> in the GTK monitor - even with the multiple echo, instead of the up/down
>> arrow keys cycling through the history instead I see the codes ^[[B and
>> ^[[A being output to the window instead.
>
> That is probably me.  The echo feature was introduced for QMP, but in
> theory it should have been limited to that.  I'll check it, thanks.

I've also seen echo, but only intermittently...

thanks
-- PMM

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

* Re: [Qemu-devel] Strange monitor/stdout issue on qemu-system-sparc/qemu-system-ppc
  2016-01-31 17:54       ` Peter Maydell
@ 2016-01-31 21:57         ` Paolo Bonzini
  2016-02-02  7:47           ` Mark Cave-Ayland
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2016-01-31 21:57 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Mark Cave-Ayland, qemu-devel



On 31/01/2016 18:54, Peter Maydell wrote:
> On 31 January 2016 at 17:19, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> On 31/01/2016 16:54, Mark Cave-Ayland wrote:
>>> I also notice that with the above commit I lose cycling through history
>>> in the GTK monitor - even with the multiple echo, instead of the up/down
>>> arrow keys cycling through the history instead I see the codes ^[[B and
>>> ^[[A being output to the window instead.
>>
>> That is probably me.  The echo feature was introduced for QMP, but in
>> theory it should have been limited to that.  I'll check it, thanks.
> 
> I've also seen echo, but only intermittently...

That smells like uninitialized memory or something like that.

Actually I'm fairly sure I tested "-monitor vc" at least, so perhaps
it's an interaction between the echo feature and "qemu-char: add logfile
facility to all chardev backends".  Anyway I'll look at it.

Paolo

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

* Re: [Qemu-devel] Strange monitor/stdout issue on qemu-system-sparc/qemu-system-ppc
  2016-01-31 21:57         ` Paolo Bonzini
@ 2016-02-02  7:47           ` Mark Cave-Ayland
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Cave-Ayland @ 2016-02-02  7:47 UTC (permalink / raw)
  To: Paolo Bonzini, Peter Maydell; +Cc: qemu-devel

On 31/01/16 21:57, Paolo Bonzini wrote:

> On 31/01/2016 18:54, Peter Maydell wrote:
>> On 31 January 2016 at 17:19, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>> On 31/01/2016 16:54, Mark Cave-Ayland wrote:
>>>> I also notice that with the above commit I lose cycling through history
>>>> in the GTK monitor - even with the multiple echo, instead of the up/down
>>>> arrow keys cycling through the history instead I see the codes ^[[B and
>>>> ^[[A being output to the window instead.
>>>
>>> That is probably me.  The echo feature was introduced for QMP, but in
>>> theory it should have been limited to that.  I'll check it, thanks.
>>
>> I've also seen echo, but only intermittently...
> 
> That smells like uninitialized memory or something like that.
> 
> Actually I'm fairly sure I tested "-monitor vc" at least, so perhaps
> it's an interaction between the echo feature and "qemu-char: add logfile
> facility to all chardev backends".  Anyway I'll look at it.

Yeah I think you're right. I did a little bit of testing yesterday and
the echo disappeared until I remembered that I'd been testing a
self-built OpenBIOS - and as soon as I reintroduced this option onto the
command line, the echo magically re-appeared.

I can reproduce this consistently under qemu-system-ppc git master like
this:

make distclean
STRIP= './configure' '--target-list=ppc-softmmu'
'--prefix=/home/build/rel-qemu-git' '--enable-gtk' '--disable-pie'

and then specifying a -bios parameter on the command line (even if it is
the same file as that normally used by QEMU):

$ ./qemu-system-ppc -bios ../share/qemu/openbios-ppc

Now try typing into the GTK monitor window and hopefully you should be
able to see the problem.


ATB,

Mark.

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

* Re: [Qemu-devel] Strange monitor/stdout issue on qemu-system-sparc/qemu-system-ppc
  2016-01-31 15:54   ` Mark Cave-Ayland
  2016-01-31 17:19     ` Paolo Bonzini
@ 2016-02-08  9:08     ` Paolo Bonzini
  2016-02-08 21:44       ` Mark Cave-Ayland
  1 sibling, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2016-02-08  9:08 UTC (permalink / raw)
  To: Mark Cave-Ayland, Peter Maydell; +Cc: qemu-devel



On 31/01/2016 16:54, Mark Cave-Ayland wrote:
> Aha! A quick test here shows that the patch fixes the serial port
> appearing on stdout and entering the monitor, but I still see the
> multiple echo problem in the GTK GUI.

And this should be it; if this fixes all your problems I will submit
it for inclusion.

Thanks,

Paolo

----------------- 8< ---------------
From: Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH] gtk: fix uninitialized temporary VirtualConsole

Only the echo field is used in the temporary VirtualConsole, so the
damage was limited.  But still, if echo was incorrectly set to true,
the result would be some puzzling output in VTE monitor and serial
consoles.

Fixes: fba958c692e47a373d15c1fd3d72b255bf76adbd
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

diff --git a/ui/gtk.c b/ui/gtk.c
index c8dbd5c..e106493 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1612,7 +1612,7 @@ static CharDriverState *gd_vc_handler(ChardevVC *vc, Error **errp)
     chr->chr_set_echo = gd_vc_chr_set_echo;
 
     /* Temporary, until gd_vc_vte_init runs.  */
-    chr->opaque = g_new(VirtualConsole, 1);
+    chr->opaque = g_new0(VirtualConsole, 1);
 
     /* defer OPENED events until our vc is fully initialized */
     chr->explicit_be_open = true;

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

* Re: [Qemu-devel] Strange monitor/stdout issue on qemu-system-sparc/qemu-system-ppc
  2016-02-08  9:08     ` Paolo Bonzini
@ 2016-02-08 21:44       ` Mark Cave-Ayland
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Cave-Ayland @ 2016-02-08 21:44 UTC (permalink / raw)
  To: Paolo Bonzini, Peter Maydell, Gerd Hoffmann; +Cc: qemu-devel

On 08/02/16 09:08, Paolo Bonzini wrote:

> On 31/01/2016 16:54, Mark Cave-Ayland wrote:
>> Aha! A quick test here shows that the patch fixes the serial port
>> appearing on stdout and entering the monitor, but I still see the
>> multiple echo problem in the GTK GUI.
> 
> And this should be it; if this fixes all your problems I will submit
> it for inclusion.
> 
> Thanks,
> 
> Paolo
> 
> ----------------- 8< ---------------
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH] gtk: fix uninitialized temporary VirtualConsole
> 
> Only the echo field is used in the temporary VirtualConsole, so the
> damage was limited.  But still, if echo was incorrectly set to true,
> the result would be some puzzling output in VTE monitor and serial
> consoles.
> 
> Fixes: fba958c692e47a373d15c1fd3d72b255bf76adbd
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> diff --git a/ui/gtk.c b/ui/gtk.c
> index c8dbd5c..e106493 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -1612,7 +1612,7 @@ static CharDriverState *gd_vc_handler(ChardevVC *vc, Error **errp)
>      chr->chr_set_echo = gd_vc_chr_set_echo;
>  
>      /* Temporary, until gd_vc_vte_init runs.  */
> -    chr->opaque = g_new(VirtualConsole, 1);
> +    chr->opaque = g_new0(VirtualConsole, 1);
>  
>      /* defer OPENED events until our vc is fully initialized */
>      chr->explicit_be_open = true;

Hi Paolo,

Thanks for the patch, I can confirm it fixes the local echo issue for
me. However I still see one more issue in the GTK monitor (I seem to be
doing well here) whereby the width of the GTK console changes size.

With git master, I start up qemu-system-ppc with the GTK interface,
switch to the monitor and type help which gives this output:
https://www.ilande.co.uk/tmp/help1.png. If I then type help again then
the output looks like https://www.ilande.co.uk/tmp/help2.png. In effect,
it looks like the width of the window is 3 characters too wide but only
for the first command.


ATB,

Mark.

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

end of thread, other threads:[~2016-02-08 21:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-31 15:19 [Qemu-devel] Strange monitor/stdout issue on qemu-system-sparc/qemu-system-ppc Mark Cave-Ayland
2016-01-31 15:34 ` Peter Maydell
2016-01-31 15:54   ` Mark Cave-Ayland
2016-01-31 17:19     ` Paolo Bonzini
2016-01-31 17:54       ` Peter Maydell
2016-01-31 21:57         ` Paolo Bonzini
2016-02-02  7:47           ` Mark Cave-Ayland
2016-02-08  9:08     ` Paolo Bonzini
2016-02-08 21:44       ` Mark Cave-Ayland

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).