All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] QEMU monitor banner printed multiple times
@ 2018-04-25  5:36 Thomas Huth
  2018-04-25 10:12 ` Marc-André Lureau
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2018-04-25  5:36 UTC (permalink / raw)
  To: QEMU Developers, Marc-André Lureau; +Cc: Paolo Bonzini

 Hi,

I just noticed that sometimes, the QEMU monitor banner is printed
multiple times when you press "CTRL-a c" to enter the monitor:

$ x86_64-softmmu/qemu-system-x86_64 -no-shutdown -nographic \
    -nodefaults -virtioconsole mon:stdio
QEMU 2.12.0 monitor - type 'help' for more information
QEMU 2.12.0 monitor - type 'help' for more information
QEMU 2.12.0 monitor - type 'help' for more information
QEMU 2.12.0 monitor - type 'help' for more information
(qemu) q
QEMU 2.12.0 monitor - type 'help' for more information
(qemu)
$

That looks quite ugly. Anybody got an idea how to fix this?

 Thomas

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

* Re: [Qemu-devel] QEMU monitor banner printed multiple times
  2018-04-25  5:36 [Qemu-devel] QEMU monitor banner printed multiple times Thomas Huth
@ 2018-04-25 10:12 ` Marc-André Lureau
  0 siblings, 0 replies; 2+ messages in thread
From: Marc-André Lureau @ 2018-04-25 10:12 UTC (permalink / raw)
  To: Thomas Huth; +Cc: QEMU Developers, Paolo Bonzini

Hi

On Wed, Apr 25, 2018 at 7:36 AM, Thomas Huth <thuth@redhat.com> wrote:
>  Hi,
>
> I just noticed that sometimes, the QEMU monitor banner is printed
> multiple times when you press "CTRL-a c" to enter the monitor:
>
> $ x86_64-softmmu/qemu-system-x86_64 -no-shutdown -nographic \
>     -nodefaults - mon:stdio
> QEMU 2.12.0 monitor - type 'help' for more information
> QEMU 2.12.0 monitor - type 'help' for more information
> QEMU 2.12.0 monitor - type 'help' for more information
> QEMU 2.12.0 monitor - type 'help' for more information
> (qemu) q
> QEMU 2.12.0 monitor - type 'help' for more information
> (qemu)
> $
>
> That looks quite ugly. Anybody got an idea how to fix this?

virtio console creates many extra events.

It's not so trivial to fix given how mux works.

What seems easy and probably safe is the following change:

diff --git a/monitor.c b/monitor.c
index 39f8ee17ba..6f4646bf0c 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4411,8 +4411,10 @@ static void monitor_event(void *opaque, int event)
         break;

     case CHR_EVENT_OPENED:
-        monitor_printf(mon, "QEMU %s monitor - type 'help' for more "
-                       "information\n", QEMU_VERSION);
+        if (!mon->reset_seen) {
+            monitor_printf(mon, "QEMU %s monitor - type 'help' for more "
+                           "information\n", QEMU_VERSION);
+        }


-- 
Marc-André Lureau

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

end of thread, other threads:[~2018-04-25 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25  5:36 [Qemu-devel] QEMU monitor banner printed multiple times Thomas Huth
2018-04-25 10:12 ` Marc-André Lureau

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.