[Top][All Lists]

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

Re: [PATCH] hw/char/pl011: fix receiving multiple chars

From: Zack Marvel
Subject: Re: [PATCH] hw/char/pl011: fix receiving multiple chars
Date: Sun, 21 Feb 2021 09:37:59 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0


Thanks for the quick review. You're right, I misunderstood the API and the bug is in ui/gtk.c.

Zack M

On 2/21/21 8:19 AM, Peter Maydell wrote:
On Sun, 21 Feb 2021 at 15:04, Zack Marvel <zpmarvel@gmail.com> wrote:

When using the GTK UI with libvte, multicharacter keystrokes are not
sent correctly (such as arrow keys). This is not an issue for e.g. the
SDL UI because qemu_chr_be_write is called with len=1 for each character
(SDL sends more than once keystroke).

Buglink: https://bugs.launchpad.net/qemu/+bug/1407808

Signed-off-by: Zack Marvel <zpmarvel@gmail.com>

@@ -300,7 +300,9 @@ static void pl011_put_fifo(void *opaque, uint32_t value)

  static void pl011_receive(void *opaque, const uint8_t *buf, int size)
-    pl011_put_fifo(opaque, *buf);
+    for (int i = 0; i < size; i++) {
+        pl011_put_fifo(opaque, buf[i]);
+    }

I think this is a bug in whatever is on the other end
of the chardev connection. The pl011 can_receive routine
only ever returns 0 or 1, so it is an error for the
code calling its receive function to ever pass a
size that is greater than 1.

-- PMM

reply via email to

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