[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-ppc] [PATCH] spapr-vty: Fix bad assert() statemen
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [Qemu-ppc] [PATCH] spapr-vty: Fix bad assert() statement |
Date: |
Thu, 10 Nov 2016 18:42:19 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 10/11/2016 18:41, Thomas Huth wrote:
> On 10.11.2016 15:41, Paolo Bonzini wrote:
>>
>>
>> On 10/11/2016 10:06, Thomas Huth wrote:
>>> When using the serial console in the GTK interface of QEMU (and
>>> QEMU has been compiled with CONFIG_VTE), it is possible to trigger
>>> the assert() statement in vty_receive() in spapr_vty.c by pasting
>>> a chunk of text with length > 16 into the QEMU window.
>>> Most of the other serial backends seem to simply drop characters
>>> that they can not handle, so I think we should also do the same in
>>> spapr-vty to fix this issue. And since it is quite ugly when pasted
>>> text is chopped after 16 bytes, we also increase the size of the
>>> input buffer here so that we can at least handle a couple of text
>>> lines.
>>>
>>> Buglink: https://bugs.launchpad.net/qemu/+bug/1639322
>>> Signed-off-by: Thomas Huth <address@hidden>
>>> ---
>>> hw/char/spapr_vty.c | 13 +++++++++++--
>>> 1 file changed, 11 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c
>>> index 31822fe..bee6c34 100644
>>> --- a/hw/char/spapr_vty.c
>>> +++ b/hw/char/spapr_vty.c
>>> @@ -1,4 +1,5 @@
>>> #include "qemu/osdep.h"
>>> +#include "qemu/error-report.h"
>>> #include "qapi/error.h"
>>> #include "qemu-common.h"
>>> #include "cpu.h"
>>> @@ -7,7 +8,7 @@
>>> #include "hw/ppc/spapr.h"
>>> #include "hw/ppc/spapr_vio.h"
>>>
>>> -#define VTERM_BUFSIZE 16
>>> +#define VTERM_BUFSIZE 2048
>>
>> This change causes a change in the migration protocol.
>
> Bummer! You're right, the buffer is listed in the vmstate_spapr_vty
> description ... so please ignore this patch, I've got to think about a
> better solution here...
Well, the assert change is still good and should be in 2.8.
Paolo