[libvirt] [PATCH] virsh: add qemu-monitor-command --pretty

Eric Blake eblake at redhat.com
Mon Oct 8 22:27:50 UTC 2012


On 10/08/2012 03:32 PM, Dave Allan wrote:
> On Thu, Oct 04, 2012 at 05:22:20PM -0600, Eric Blake wrote:
>> I was using qemu-monitor-command during development, and found it quite
>> hard to use.  Compare the results of this patch on ease of reading:
>>

>> Note that 'qemu-monitor-command dom --pretty --hmp info version'
>> happens to truncate 0.12.1(qemu-kvm-0.12.1.2) into just 0.12 (since
>> that is the portion of the prefix of the string that forms a valid
>> JSON subsequence); we probably have a bug in virJSONValueFromString
>> for not rejecting trailing junk, but that's a matter for another
>> patch; for now, I just documented that --hmp and --pretty don't
>> make sense together in the man page.
> 
> I'd tweak the patch to reject the combination of --hmp and --pretty;
> other than that it looks like a great readability enhancement.

Done, and pushed.  (I suppose if you still target a really old qemu
where --hmp is a no-op because there is no qmp monitor, then --pretty in
isolation will still truncate the HMP result from that command, but
that's more of a corner case that I can still live with).

>>
>> -=item B<qemu-monitor-command> I<domain> [I<--hmp>] I<command>...
>> +=item B<qemu-monitor-command> I<domain> { [I<--hmp>] | [I<--pretty>] }

In fact, I had already documented them as mutually exclusive :)

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121008/cb4f6a44/attachment-0001.sig>


More information about the libvir-list mailing list