Re: [Autotest] [KVM-AUTOTEST PATCH] [RFC] KVM test: kvm_monitor.py: refactor _get_command_output()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> 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


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux