
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@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org