public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: autotest@test.kernel.org, kvm@vger.kernel.org
Subject: Re: [KVM-AUTOTEST PATCH] [RFC] KVM test: kvm_monitor.py: refactor _get_command_output()
Date: Mon, 18 Oct 2010 21:00:42 -0200	[thread overview]
Message-ID: <1287442842.30496.2.camel@freedom> (raw)
In-Reply-To: <20101018162551.7cc592ac@doriath>

On Mon, 2010-10-18 at 16:25 -0200, Luiz Capitulino wrote:
> On Mon, 18 Oct 2010 14:28:44 -0200
> Lucas Meneghel Rodrigues <lmr@redhat.com> wrote:
> 
> > On Mon, 2010-10-18 at 15:13 +0200, Michael Goldish wrote:
> > > Instead of _get_command_output() and friends, introduce the following methods:
> > > 
> > > * QMP:
> > >   - _send(): send raw data without waiting for a response
> > >   - _get_response(): get the response to a previously sent command
> > >   - cmd(): send a command with arguments, return response, raise an exception
> > >            if the command fails
> > >   - cmd_raw(): send a raw string, return response dict without postprocessing
> > >   - cmd_obj(): send a Python object (converted to JSON), return response dict
> > >                without postprocessing
> > >   - cmd_qmp(): send a command with arguments, return response dict without
> > >                postprocessing
> > > 
> > >   cmd() is useful for common monitor usage.  cmd_raw(), cmd_obj() and
> > >   cmd_qmp() are required by Luiz Capitulino's test suite.  The difference
> > >   between cmd() and cmd_qmp() is that the latter does not perform any checks
> > >   on the response dict.  Note that cmd_raw() is functionally equivalent to
> > >   send() from Luiz's patch.  I propose that we use the name cmd_raw() because
> > >   send() implies sending data without caring about the response, whereas
> > >   cmd_raw() implies doing exactly what cmd_obj() and cmd_qmp() do, but using
> > >   raw data.
> > > 
> > > * Human monitor:
> > >   - _send(): send raw data without waiting for a response
> > >   - cmd(): send a command, return response
> > 
> > This patch does look reasonable to me. Luiz, what about rewriting your
> > patchset after I apply this to upstream?	
> 
> Yeah, looks like a good idea.

Ok, commited:

http://autotest.kernel.org/changeset/4866

About the select() suggestion, I think it does make sense to use it, but
I also want to hear from Michael if he had found any problems with using
select while testing the patches. So the patch is integrated, and you
can write your v2 of the patches based on it, and any further
improvement is possible, once the base function names are already there.

Cheers,

Lucas

  reply	other threads:[~2010-10-18 23:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-18 13:13 [KVM-AUTOTEST PATCH] KVM test: kvm_subprocess.py: reset _thread_kill_requested in kill_tail_threads() Michael Goldish
2010-10-18 13:13 ` [KVM-AUTOTEST PATCH] KVM test: whql_client_install: fix retrieval of server_dns_suffix Michael Goldish
2010-10-18 13:13   ` [KVM-AUTOTEST PATCH] [RFC] KVM test: kvm_monitor.py: refactor _get_command_output() Michael Goldish
2010-10-18 13:13     ` [KVM-AUTOTEST PATCH] KVM test: kvm_monitor.py: add __str__() method to QMPCmdError exception Michael Goldish
2010-10-18 16:28     ` [Autotest] [KVM-AUTOTEST PATCH] [RFC] KVM test: kvm_monitor.py: refactor _get_command_output() Lucas Meneghel Rodrigues
2010-10-18 18:25       ` Luiz Capitulino
2010-10-18 23:00         ` Lucas Meneghel Rodrigues [this message]
2010-10-18 18:45     ` Luiz Capitulino
2010-10-19  7:03       ` Michael Goldish

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=1287442842.30496.2.camel@freedom \
    --to=lmr@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=lcapitulino@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox