All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v5 10/10] test-qga: Actually test 0xff sync bytes
Date: Wed, 03 May 2017 10:57:41 +0200	[thread overview]
Message-ID: <87a86u48sa.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <149374416427.32299.10266856249198036332@loki> (Michael Roth's message of "Tue, 02 May 2017 11:56:04 -0500")

Michael Roth <mdroth@linux.vnet.ibm.com> writes:

> Quoting Michael Roth (2017-05-02 11:46:36)
>> Quoting Eric Blake (2017-04-27 16:58:21)
>> > Commit 62c39b3 introduced test-qga, and at face value, appears
>> > to be testing the 'guest-sync' behavior that is recommended for
>> > guests in sending 0xff to QGA to force the parser to reset.  But
>> > this aspect of the test has never actually done anything: the
>> > qmp_fd() call chain converts its string argument into QObject,
>> > then converts that QObject back to the actual string that is
>> > sent over the wire - and the conversion process silently drops
>> > the 0xff byte from the string sent to QGA, thus never resetting
>> > the QGA parser.
>> > 
>> > An upcoming patch will get rid of the wasteful round trip
>> > through QObject, at which point the string in test-qga will be
>> > directly sent over the wire.
>> > 
>> > But fixing qmp_fd() to actually send 0xff over the wire is not
>> > all we have to do - the actual QMP parser loudly complains that
>> > 0xff is not valid JSON, and sends an error message _prior_ to
>> > actually parsing the 'guest-sync' or 'guest-sync-delimited'
>> > command.  With 'guest-sync', we cannot easily tell if this error
>> > message is a result of our command - which is WHY we invented
>> > the 'guest-sync-delimited' command.  So for the testsuite, fix
>> > things to only check 0xff behavior on 'guest-sync-delimited',
>> > and to loop until we've consumed all garbage prior to the
>> > requested delimiter, which matches the documented actions that
>> > a real QGA client is supposed to do.
>> 
>> The full re-sync sequence is actually to perform that process,
>> check if the response matches the client-provided sync token,
>> and then repeat the procedure if it doesn't (in the odd case
>> that a previous client initiated a guest-sync-delimited
>> sequence and never consumed the response). The current
>> implementation only performs one iteration so it's not quite
>> a full implementation of the documentation procedure.
>
> Well, to be more accurate it's a full implementation of the
> documented procedure, it's just that the procedure isn't
> fully documented properly. I'll send a patch to address that.

Good.

>> For the immediate purpose of improving the handling to deal
>> with the 0xFF-generated error the patch seems sound though,
>> maybe just something worth noting in the commit msg or
>> comments so that we might eventually test the full procedure.

Feel free to suggest something for me to add to the commit message.

>> In any case:
>> 
>> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>

Noted, thanks!

  reply	other threads:[~2017-05-03  8:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27 21:58 [Qemu-devel] [PATCH v5 00/10] qapi-related cleanups Eric Blake
2017-04-27 21:58 ` [Qemu-devel] [PATCH v5 01/10] pci: Use struct instead of QDict to pass back parameters Eric Blake
2017-04-27 21:58 ` [Qemu-devel] [PATCH v5 02/10] pci: Reduce scope of error injection Eric Blake
2017-04-27 21:58 ` [Qemu-devel] [PATCH v5 03/10] coccinelle: Add script to remove useless QObject casts Eric Blake
2017-04-27 21:58 ` [Qemu-devel] [PATCH v5 04/10] qobject: Drop " Eric Blake
2017-04-27 21:58 ` [Qemu-devel] [PATCH v5 05/10] qobject: Add helper macros for common scalar insertions Eric Blake
2017-04-27 21:58 ` [Qemu-devel] [PATCH v5 06/10] qobject: Use simpler QDict/QList scalar insertion macros Eric Blake
2017-04-28  8:33   ` Markus Armbruster
2017-04-28  8:33   ` Markus Armbruster
2017-05-02 15:56     ` Stefan Hajnoczi
2017-05-02 15:56       ` Stefan Hajnoczi
2017-05-02 16:26       ` Markus Armbruster
2017-05-02 16:26       ` Markus Armbruster
     [not found]     ` <e95da4dd-ae83-ea7b-73bb-849a88e8e049@suse.com>
2017-05-02 17:30       ` [Qemu-devel] [Research] Strato HiDrive as a Dropbox Replacement? Michal Suchánek
2017-05-08 14:48     ` [Qemu-devel] [PATCH v5 06/10] qobject: Use simpler QDict/QList scalar insertion macros Alberto Garcia
2017-05-08 14:48       ` Alberto Garcia
2017-05-09  7:14       ` Markus Armbruster
2017-05-09  7:14       ` Markus Armbruster
2017-04-27 21:58 ` Eric Blake
2017-04-27 21:58 ` [Qemu-devel] [PATCH v5 07/10] block: Simplify bdrv_append_temp_snapshot() logic Eric Blake
2017-04-27 21:58 ` [Qemu-devel] [PATCH v5 08/10] QemuOpts: Simplify qemu_opts_to_qdict() Eric Blake
2017-04-27 21:58 ` [Qemu-devel] [PATCH v5 09/10] fdc-test: Avoid deprecated 'change' command Eric Blake
2017-04-27 21:58 ` [Qemu-devel] [PATCH v5 10/10] test-qga: Actually test 0xff sync bytes Eric Blake
2017-05-02 16:46   ` Michael Roth
2017-05-02 16:56     ` Michael Roth
2017-05-03  8:57       ` Markus Armbruster [this message]
2017-05-03 19:52         ` Michael Roth
2017-05-04  7:23           ` Markus Armbruster
2017-05-04 13:16             ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a86u48sa.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.