From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpCq8-0002sJ-Od for qemu-devel@nongnu.org; Fri, 14 Nov 2014 04:06:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpCpz-0006wm-49 for qemu-devel@nongnu.org; Fri, 14 Nov 2014 04:06:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpCpy-0006wi-Rs for qemu-devel@nongnu.org; Fri, 14 Nov 2014 04:06:39 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAE96cgk019331 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 14 Nov 2014 04:06:38 -0500 From: Max Reitz Date: Fri, 14 Nov 2014 10:06:33 +0100 Message-Id: <1415955996-14267-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v3 0/3] chardev: Add -qmp-pretty List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi , Max Reitz This series does not add new functionality. Adding a QMP monitor with prettily formatted JSON output can be done as follows: $ qemu -chardev stdio,id=mon0 -mon chardev=mon0,mode=control,pretty=on However, this is rather cumbersome, so this series (its first patch) adds a shortcut in the form of the new command line option -qmp-pretty. Since the argument given to a monitor command line option (such as -qmp) is parsed depending on its prefix and probably also depending on the current phase of the moon, this is cleaner than trying to add a "switch" to -qmp itself (in the form of "-qmp stdio,pretty=on"). Patch 3 makes uses of the new option in qemu-iotest 067 to greatly increase maintainability of its reference output. Patch 2 extends the QMP filter for qemu-iotests so it is able to filter out the QMP version object in pretty mode. v3: - Patch 2: Cull useless "discard=0" v2: - Patch 2: Replaced the multi-line QMP_VERSION replacement written in bash by a nice sed script [Eric] git-backport-diff against v1: Key: [----] : patches are identical [####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively 001/3:[----] [--] 'chardev: Add -qmp-pretty' 002/3:[0015] [FC] 'iotests: _filter_qmp for pretty JSON output' 003/3:[----] [--] 'iotests: Use -qmp-pretty in 067' Max Reitz (3): chardev: Add -qmp-pretty iotests: _filter_qmp for pretty JSON output iotests: Use -qmp-pretty in 067 qemu-options.hx | 8 + tests/qemu-iotests/067 | 2 +- tests/qemu-iotests/067.out | 779 ++++++++++++++++++++++++++++++++++++--- tests/qemu-iotests/common.filter | 3 +- vl.c | 15 +- 5 files changed, 743 insertions(+), 64 deletions(-) -- 1.9.3