Received: from eggs.gnu.org ([2001:4830:134:3::10]:37044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn6Oa-0003ke-9M for qemu-devel@nongnu.org; Thu, 22 Sep 2016 11:58:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn6OX-0000ZE-Gx for qemu-devel@nongnu.org; Thu, 22 Sep 2016 11:58:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn6OX-0000Yp-7n for qemu-devel@nongnu.org; Thu, 22 Sep 2016 11:58:41 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB387C093543 for ; Thu, 22 Sep 2016 15:58:40 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 22 Sep 2016 19:58:07 +0400 Message-Id: <20160922155808.8504-4-marcandre.lureau@redhat.com> In-Reply-To: <20160922155808.8504-1-marcandre.lureau@redhat.com> References: <20160922155808.8504-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 3/4] docs: add qapi texi template List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: eblake@redhat.com, armbru@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= The qapi2texi scripts uses a template for the texi file. Since we are going to generate the documentation in multiple formats, move qmp-intro to qemu-qapi template. (it would be nice to write something similar for qemu-ga, but this is left for a future patch) Signed-off-by: Marc-Andr=C3=A9 Lureau --- docs/qemu-ga-qapi.template.texi | 58 ++++++++++++++++ docs/qemu-qapi.template.texi | 148 ++++++++++++++++++++++++++++++++++= ++++++ docs/qmp-intro.txt | 87 ----------------------- 3 files changed, 206 insertions(+), 87 deletions(-) create mode 100644 docs/qemu-ga-qapi.template.texi create mode 100644 docs/qemu-qapi.template.texi delete mode 100644 docs/qmp-intro.txt diff --git a/docs/qemu-ga-qapi.template.texi b/docs/qemu-ga-qapi.template= .texi new file mode 100644 index 0000000..3ddbf56 --- /dev/null +++ b/docs/qemu-ga-qapi.template.texi @@ -0,0 +1,58 @@ +\input texinfo +@setfilename qemu-ga-qapi +@documentlanguage en +@exampleindent 0 +@paragraphindent 0 + +@settitle QEMU-GA QAPI Reference Manual + +@ifinfo +@direntry +* QEMU-GA-QAPI: (qemu-doc). QEMU-GA QAPI Reference Manual +@end direntry +@end ifinfo + +@iftex +@titlepage +@sp 7 +@center @titlefont{{QEMU Guest Agent {version}}} +@sp 1 +@center @titlefont{{QAPI Reference Manual}} +@sp 3 +@end titlepage +@end iftex + +@ifnottex +@node Top +@top + +This is the QEMU Guest Agent QAPI reference for QEMU {version}. + +@menu +* API Reference:: +* Commands and Events Index:: +* Data Types Index:: +@end menu + +@end ifnottex + +@contents + +@node API Reference +@chapter API Reference + +@c man begin DESCRIPTION +{qapi} +@c man end + +@c man begin SEEALSO +The HTML documentation of QEMU for more precise information. +@c man end + +@node Commands and Events Index +@unnumbered Commands and Events Index +@printindex fn +@node Data Types Index +@unnumbered Data Types Index +@printindex tp +@bye diff --git a/docs/qemu-qapi.template.texi b/docs/qemu-qapi.template.texi new file mode 100644 index 0000000..102c8d9 --- /dev/null +++ b/docs/qemu-qapi.template.texi @@ -0,0 +1,148 @@ +\input texinfo +@setfilename qemu-qapi +@documentlanguage en +@exampleindent 0 +@paragraphindent 0 + +@settitle QEMU QAPI Reference Manual + +@ifinfo +@direntry +* QEMU: (qemu-doc). QEMU QAPI Reference Manual +@end direntry +@end ifinfo + +@iftex +@titlepage +@sp 7 +@center @titlefont{{QEMU Emulator {version}}} +@sp 1 +@center @titlefont{{QAPI Reference Manual}} +@sp 3 +@end titlepage +@end iftex + +@ifnottex +@node Top +@top + +This is the QMP QAPI reference for QEMU {version}. + +@menu +* Introduction:: +* API Reference:: +* Commands and Events Index:: +* Data Types Index:: +@end menu + +@end ifnottex + +@contents + +@node Introduction +@chapter Introduction + +The QEMU Machine Protocol (@acronym{{QMP}}) allows applications to +operate a QEMU instance. + +QMP is @uref{{http://www.json.org, JSON}} based and features the +following: + +@itemize @minus +@item +Lightweight, text-based, easy to parse data format +@item +Asynchronous messages support (ie. events) +@item +Capabilities Negotiation +@end itemize + +For detailed information on QEMU Machine Protocol, the specification +is in @file{{qmp-spec.txt}}. + +@section Usage + +You can use the @option{{-qmp}} option to enable QMP. For example, the +following makes QMP available on localhost port 4444: + +@example +$ qemu [...] -qmp tcp:localhost:4444,server,nowait +@end example + +However, for more flexibility and to make use of more options, the +@option{{-mon}} command-line option should be used. For instance, the +following example creates one HMP instance (human monitor) on stdio +and one QMP instance on localhost port 4444: + +@example +$ qemu [...] -chardev stdio,id=3Dmon0 -mon chardev=3Dmon0,mode=3Dreadlin= e \ + -chardev socket,id=3Dmon1,host=3Dlocalhost,port=3D4444,serv= er,nowait \ + -mon chardev=3Dmon1,mode=3Dcontrol,pretty=3Don +@end example + +Please, refer to QEMU's manpage for more information. + +@section Simple testing + +To manually test QMP one can connect with telnet and issue commands by +hand: + +@example +$ telnet localhost 4444 +Trying 127.0.0.1... +Connected to localhost. +Escape character is '^]'. +@{{ + "QMP": @{{ + "version": @{{ + "qemu": @{{ + "micro": 50, + "minor": 6, + "major": 1 + @}}, + "package": "" + @}}, + "capabilities": [ + ] + @}} +@}} + +@{{ "execute": "qmp_capabilities" @}} +@{{ + "return": @{{ + @}} +@}} + +@{{ "execute": "query-status" @}} +@{{ + "return": @{{ + "status": "prelaunch", + "singlestep": false, + "running": false + @}} +@}} +@end example + +@section Wiki + +Please refer to the @uref{{http://wiki.qemu-project.org/QMP, QMP QEMU + wiki page}} for more details on QMP. + +@node API Reference +@chapter API Reference + +@c man begin DESCRIPTION +{qapi} +@c man end + +@c man begin SEEALSO +The HTML documentation of QEMU for more precise information. +@c man end + +@node Commands and Events Index +@unnumbered Commands and Events Index +@printindex fn +@node Data Types Index +@unnumbered Data Types Index +@printindex tp +@bye diff --git a/docs/qmp-intro.txt b/docs/qmp-intro.txt deleted file mode 100644 index f6a3a03..0000000 --- a/docs/qmp-intro.txt +++ /dev/null @@ -1,87 +0,0 @@ - QEMU Machine Protocol - =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D - -Introduction ------------- - -The QEMU Machine Protocol (QMP) allows applications to operate a -QEMU instance. - -QMP is JSON[1] based and features the following: - -- Lightweight, text-based, easy to parse data format -- Asynchronous messages support (ie. events) -- Capabilities Negotiation - -For detailed information on QMP's usage, please, refer to the following = files: - -o qmp-spec.txt QEMU Machine Protocol current specification -o qmp-commands.txt QMP supported commands (auto-generated at build-time= ) -o qmp-events.txt List of available asynchronous events - -[1] http://www.json.org - -Usage ------ - -You can use the -qmp option to enable QMP. For example, the following -makes QMP available on localhost port 4444: - -$ qemu [...] -qmp tcp:localhost:4444,server,nowait - -However, for more flexibility and to make use of more options, the -mon -command-line option should be used. For instance, the following example -creates one HMP instance (human monitor) on stdio and one QMP instance -on localhost port 4444: - -$ qemu [...] -chardev stdio,id=3Dmon0 -mon chardev=3Dmon0,mode=3Dreadlin= e \ - -chardev socket,id=3Dmon1,host=3Dlocalhost,port=3D4444,serv= er,nowait \ - -mon chardev=3Dmon1,mode=3Dcontrol,pretty=3Don - -Please, refer to QEMU's manpage for more information. - -Simple Testing --------------- - -To manually test QMP one can connect with telnet and issue commands by h= and: - -$ telnet localhost 4444 -Trying 127.0.0.1... -Connected to localhost. -Escape character is '^]'. -{ - "QMP": { - "version": { - "qemu": { - "micro": 50,=20 - "minor": 6,=20 - "major": 1 - },=20 - "package": "" - },=20 - "capabilities": [ - ] - } -} - -{ "execute": "qmp_capabilities" } -{ - "return": { - } -} - -{ "execute": "query-status" } -{ - "return": { - "status": "prelaunch",=20 - "singlestep": false,=20 - "running": false - } -} - -Please, refer to the qapi-schema.json file for a complete command refere= nce. - -QMP wiki page -------------- - -http://wiki.qemu-project.org/QMP --=20 2.10.0