Re: [Qemu-devel] [RFC PATCH v2] qmp.py: Fix exception parsing partial JSON

2018-06-08 Thread Eduardo Habkost
On Fri, Jun 08, 2018 at 07:57:55PM +0200, Lukáš Doktor wrote: > Hello guys, > > Dne 7.6.2018 v 01:06 Philippe Mathieu-Daudé napsal(a): > > On 06/06/2018 05:05 PM, Eduardo Habkost wrote: > >> On Wed, Jun 06, 2018 at 04:27:31PM -0300, Philippe Mathieu-Daudé wrote: > >>> The readline() call returns

Re: [Qemu-devel] [RFC PATCH v2] qmp.py: Fix exception parsing partial JSON

2018-06-08 Thread Lukáš Doktor
Hello guys, Dne 7.6.2018 v 01:06 Philippe Mathieu-Daudé napsal(a): > On 06/06/2018 05:05 PM, Eduardo Habkost wrote: >> On Wed, Jun 06, 2018 at 04:27:31PM -0300, Philippe Mathieu-Daudé wrote: >>> The readline() call returns partial data. >> >> How can this be reproduced? Despite not being

Re: [Qemu-devel] [RFC PATCH v2] qmp.py: Fix exception parsing partial JSON

2018-06-06 Thread Philippe Mathieu-Daudé
On 06/06/2018 05:05 PM, Eduardo Habkost wrote: > On Wed, Jun 06, 2018 at 04:27:31PM -0300, Philippe Mathieu-Daudé wrote: >> The readline() call returns partial data. > > How can this be reproduced? Despite not being forbidden by the > QMP specification, QEMU normally doesn't break QMP replies in

Re: [Qemu-devel] [RFC PATCH v2] qmp.py: Fix exception parsing partial JSON

2018-06-06 Thread Eduardo Habkost
On Wed, Jun 06, 2018 at 04:27:31PM -0300, Philippe Mathieu-Daudé wrote: > The readline() call returns partial data. How can this be reproduced? Despite not being forbidden by the QMP specification, QEMU normally doesn't break QMP replies in multiple lines, and readline() is not supposed to

[Qemu-devel] [RFC PATCH v2] qmp.py: Fix exception parsing partial JSON

2018-06-06 Thread Philippe Mathieu-Daudé
The readline() call returns partial data. Keep appending until the JSON buffer is complete. This fixes: $ scripts/qmp/qmp-shell -v -p /tmp/qmp.sock Traceback (most recent call last): File "scripts/qmp/qmp-shell", line 456, in main() File "scripts/qmp/qmp-shell", line