[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 02/26] libqtest: Work around a "QMP wants a n
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 02/26] libqtest: Work around a "QMP wants a newline" bug |
Date: |
Mon, 27 Feb 2017 10:36:40 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 02/26/2017 03:43 PM, Markus Armbruster wrote:
> The next commit is going to add a test that calls qmp("null").
> Curiously, this hangs. Here's why.
>
> qmp_fd_sendv() doesn't send newlines. Not even when @fmt contains
> some. At first glance, the QMP parser seems to be fine with that.
> However, it turns out that it fails to react to input until it sees
> either a newline, an object or an array. To reproduce, feed to a QMP
> monitor like this:
>
> $ echo -n 'null' | socat UNIX:/work/armbru/images/test-qmp STDIO
I didn't point this out last time, but 'echo -n' is not portable. On
the other hand, it is sufficient for the example in the commit message,
so no need to change.
> {"QMP": {"version": {"qemu": {"micro": 50, "minor": 8, "major": 2},
> "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}
>
> No output after the greeting.
>
> Work around this QMP bug by having qmp_fd_sendv() append a newline.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
R-b stands.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v2 00/26] qapi: QMP dispatch and input visitor work, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 08/26] qmp: Improve QMP dispatch error messages, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 01/26] qga: Fix crash on non-dictionary QMP argument, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 11/26] qapi: Make QObject input visitor set *list reliably, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 02/26] libqtest: Work around a "QMP wants a newline" bug, Markus Armbruster, 2017/02/26
- Re: [Qemu-devel] [PATCH v2 02/26] libqtest: Work around a "QMP wants a newline" bug,
Eric Blake <=
- [Qemu-devel] [PATCH v2 13/26] qapi: Drop string input visitor method optional(), Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 22/26] test-qobject-input-visitor: Cover missing nested struct member, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 10/26] qapi: Clean up after commit 3d344c2, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 04/26] qmp: Dumb down how we run QMP command registration, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 19/26] test-string-input-visitor: Tear down existing test automatically, Markus Armbruster, 2017/02/26