All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Vadim Galitsyn <vadim.galitsyn@profitbricks.com>,
	imammedo@redhat.com, Mohammed Gamal <mgamal@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] hmp, qmp: introduce "info memory" and "query-memory" commands
Date: Tue, 20 Jun 2017 16:10:00 +0200	[thread overview]
Message-ID: <874lva21jb.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170614154043.GE2687@work-vm> (David Alan Gilbert's message of "Wed, 14 Jun 2017 16:40:43 +0100")

"Dr. David Alan Gilbert" <dgilbert@redhat.com> writes:

> * Vadim Galitsyn (vadim.galitsyn@profitbricks.com) wrote:
>> Hi Dave,
>> 
>> Thank you for the feedback!
>> 
>> > I think you need to use the PRIu64 macros rather than 'lu' for the types
>> > of the ints there to keep it portable.
>> 
>> Agree, patch v3 will include this change.
>
> Thanks.
>
>> > Other than that; please add a test entry to tests/test-hmp.c
>> > and I'm guessing you'll also need a qmp test for it.
>> 
>> As far as I can see in tests/test-hmp.c, it's automatically there.
>> The routine test_info_commands() enumerates all the available "info"
>> sub-commands with "info help" and tries to execute them, so it looks
>> like no extra stuff needs to be done here (please correct me if I am wrong).
>
> Ah yes you're right; I forgot the 'info' commands were automatic.
>
>> Regarding to QMP test, I cannot find any test under tests/ which
>> does similar job as in tests/test-hmp.c. There is neither HMP commands
>> iteration nor command-specific separate tests. Under tests/qapi-schema/
>> there are set of .json's though, however, again, it looks more like general
>> tests set (not commands-specific one).
>> 
>> It seems that all the HMP related tests do general checks -- targeting
>> HMP "engine" itself. I would say, Avocado (avocado-vt) test suite can
>> be extended with "query-memory" test, and I can certainly provide one.
>> But this topic is for another mainling list.
>
> Yes hmm not sure where to put the qmp test, I just know that Markus does
> like them (I think he's out this week).

The best time to start requiring tests for new QMP commands is when the
first command is added.  We missed that opportunity.  The second best
time is right now[*].

The QMP equivalent to test-hmp.c's test_info_commands() would be good
enough for query-FOOs that can't fail.  We should have that.  It's not
fair to ask you to write it.  Not least because doing it right involves
introspection, which is going to be a bit hairy.  I guess I'll have to
do it myself[**].

However, your query-memory looks like it could fail.  Failure modes need
to be covered by test cases.  Please either explain why it can't
actually fail, or explain why testing the failure isn't practical, or
write a suitable test.  A mere sketch hacked into qmp-test.c is
perfectly okay, we can take it from there together.



[*] Or rather last March:
Message-ID: <871sugkrw5.fsf@dusky.pond.sub.org>
https://lists.gnu.org/archive/html/qemu-devel/2017-03/msg00296.html

[**] Surprise me!  Patches welcome :)

  reply	other threads:[~2017-06-20 14:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 14:05 [Qemu-devel] [PATCH v2] hmp, qmp: introduce "info memory" and "query-memory" commands Vadim Galitsyn
2017-06-13 14:59 ` no-reply
2017-06-14  6:52   ` Fam Zheng
2017-06-14  9:22 ` Dr. David Alan Gilbert
2017-06-14 15:20   ` Vadim Galitsyn
2017-06-14 15:40     ` Dr. David Alan Gilbert
2017-06-20 14:10       ` Markus Armbruster [this message]
2017-06-22 15:02         ` Vadim Galitsyn
2017-06-23  6:44           ` Markus Armbruster

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=874lva21jb.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mgamal@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vadim.galitsyn@profitbricks.com \
    /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.