[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 04/11] hw/char/spapr_vty: Return amount of free buffer
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 04/11] hw/char/spapr_vty: Return amount of free buffer entries in vty_can_receive() |
Date: |
Wed, 23 Nov 2016 13:49:36 +1100 |
From: Thomas Huth <address@hidden>
The can_receive() callbacks of the character devices should return
the amount of characters that can be accepted at once, not just a
boolean value (which rather means only one character at a time).
Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/char/spapr_vty.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c
index 06b9b39..7c22b8b 100644
--- a/hw/char/spapr_vty.c
+++ b/hw/char/spapr_vty.c
@@ -25,7 +25,7 @@ static int vty_can_receive(void *opaque)
{
VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(opaque);
- return (dev->in - dev->out) < VTERM_BUFSIZE;
+ return VTERM_BUFSIZE - (dev->in - dev->out);
}
static void vty_receive(void *opaque, const uint8_t *buf, int size)
--
2.7.4
- [Qemu-ppc] [PULL 00/11] ppc-for-2.8 queue 20161123, David Gibson, 2016/11/22
- [Qemu-ppc] [PULL 01/11] tests/postcopy: Use KVM on ppc64 only if it is KVM-HV, David Gibson, 2016/11/22
- [Qemu-ppc] [PULL 03/11] ppc: BOOK3E: nothing should be done when MSR:PR is set, David Gibson, 2016/11/22
- [Qemu-ppc] [PULL 04/11] hw/char/spapr_vty: Return amount of free buffer entries in vty_can_receive(),
David Gibson <=
- [Qemu-ppc] [PULL 02/11] spapr: migration support for CAS-negotiated option vectors, David Gibson, 2016/11/22
- [Qemu-ppc] [PULL 11/11] spapr: Fix 2.7<->2.8 migration of PCI host bridge, David Gibson, 2016/11/22
- [Qemu-ppc] [PULL 07/11] target-ppc: Fix CPU migration from qemu-2.6 <-> later versions, David Gibson, 2016/11/22
- [Qemu-ppc] [PULL 09/11] target-ppc: Allow eventual removal of old migration mistakes, David Gibson, 2016/11/22
- [Qemu-ppc] [PULL 10/11] Revert "spapr: Fix migration of PCI host bridges from qemu-2.7", David Gibson, 2016/11/22
- [Qemu-ppc] [PULL 08/11] migration: Add VMSTATE_UINTTL_TEST(), David Gibson, 2016/11/22
- [Qemu-ppc] [PULL 06/11] ppc: Make uninorth interrupt swizzling identical to Grackle, David Gibson, 2016/11/22
- [Qemu-ppc] [PULL 05/11] target-ppc: fix index array of national digits, David Gibson, 2016/11/22