From patchwork Thu Apr 20 15:03:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 675633 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp369066wrs; Thu, 20 Apr 2023 08:07:46 -0700 (PDT) X-Google-Smtp-Source: AKy350ad18hTWWNyZc9h54gGZJIPfc9FXnMchhpIeNEZM6ZhPSeFKn9kyxLp3rsLAuokK3dTXO9i X-Received: by 2002:a05:6214:2683:b0:5f1:6892:7449 with SMTP id gm3-20020a056214268300b005f168927449mr2367977qvb.28.1682003266569; Thu, 20 Apr 2023 08:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682003266; cv=none; d=google.com; s=arc-20160816; b=S99kHSGxqbJmFeklRfMYrHfSudr7FWwjZ+1DXCskdsBeytjBOlDpdpJ6xynx90Bks6 zJYp2AbFMlDuWF2GYZVK4/pl3U292KCkDj+HtylDAV5SqrnQEozlk8EHXirNQvHB2hkF gXy2gRtGdsILfQ/plYUE3r9zB0b47Brlkp683EpHhv6xX3nfKm84pz0pDuxt/woss3Bs LOlm9LjCYyXlB8eNgWJijQptAkNEZDrbBavhdLmKD+2231ekB+jOy5OpxnoSdPVlN99P ri8wziztHdaumYpuwYB2bKTZqFSQGZRTc9Zc5WnQvbpTaCHjnES8BCceGURdSK/mLcVA d1BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZbSk7BG+pPYbXSNkcmisOU5yI5C0OADLfXQ8nDPotNk=; b=KglsdPvKHoQ7X3jt2J6th6g2cBwssA7AjHjDxg7zdJMJc97mbH0iD6DXyrMHIeIGXJ 11dWsyBEFbmuAW4hAA8zSdEaEo4P20O/df6awpkifuLaw49Wo2VJJk3KNgLePd4XUSGY 1B1ZlNzJx43szowDJGxXKG1/N7qmcayMk5qzrBYIQow+dk7jDEi0i/YwIM9qMVTldbgp 9jPRDv8sQnJ1YhZ7f/bodqrAHLfjQSECThmxfjGOwKrjSzphfTwxfvc7uPXEkbgLOz9K nCSHlRJ7batcPNOSvIJtTvuLAXhEXyMcJPTVfn5M2o6c/SyxlyCNgxKe3vU2cgGbB4V7 rHww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VCErB2+5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d20-20020a05620a241400b0074adffe3bb1si1403910qkn.122.2023.04.20.08.07.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Apr 2023 08:07:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VCErB2+5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVpW-0004bo-MR; Thu, 20 Apr 2023 11:04:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppVpU-0004TN-K7 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:04:12 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppVpF-0004zW-1v for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:04:12 -0400 Received: by mail-wm1-x32c.google.com with SMTP id l31-20020a05600c1d1f00b003f1718d89b2so3256278wms.0 for ; Thu, 20 Apr 2023 08:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682003035; x=1684595035; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZbSk7BG+pPYbXSNkcmisOU5yI5C0OADLfXQ8nDPotNk=; b=VCErB2+5xXmL9LiIHMfwC96mWIP478/dwHuQuaM3M9w9UTZYR38koKuottg9UpvEuA I9ChBgBflxx2HBSLcfuMX2Q5ihIGM9XU1rhZO+Vijqmoug+eEBi46vfzhxhLa0Ds3Sqp L2Ub3fpS8qZoGN6geLAmgkEBdYYNp1QjIqOuv5kSkGnq88LodF5cUFYa8DFy/d9GB76/ 2gfWFBqnAcFxfIieK6CFCQGxsOdzdnV4wI5ifuTvxxZd68InGnVTPgyeFOYjWHBZcxbo ZhafLstX6tZnebulCP2fRF0CjqquWqabgk7WG/OnO3pN9GeMN2gP4NXgfq3bMqMW6I18 SNPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682003035; x=1684595035; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZbSk7BG+pPYbXSNkcmisOU5yI5C0OADLfXQ8nDPotNk=; b=WfLlahrSx+UhreP/wohEDjGAfyJKbsjRJ0INonrjDCqcAV5g1jNLfYJ65bx2agEh2H zouMDkLPc5GcJ83S1VJXYij5vNC1dP+c0EVOWgh8mSCT/gC4oMXAcWB22z6g3yzsvLom kN9AK6Nw09EA2L7NRRS1jkzsid3ZOLAc/mTwqb59IAceTFxig1PyzIkUWR3Bh9rPqXHO XRglI0S/FHS20Cv1yWU9NF0wXXlGAIwm8FjOHLb5+PcdpTxEP74IBSuGSJxHLNV3SXXK r/E9+/+J82tlBtwUrX2ITFzR0wWEq5p0FcEco+VE3ZiVHc6sB87+6BxhGK1GqiZZN2OH 7/7A== X-Gm-Message-State: AAQBX9cLMhNb23MWLAHMI8Lz/Jwa3cYP1VPQ0gl0JPhpX3/JQSx/EYLa fzQ+LHIGn5f2IE/H6IxOFfSvLRIJwY8JjzS3V5U= X-Received: by 2002:a1c:7712:0:b0:3f1:70d5:1be8 with SMTP id t18-20020a1c7712000000b003f170d51be8mr1669549wmi.15.1682003035494; Thu, 20 Apr 2023 08:03:55 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y32-20020a05600c342000b003f173956a82sm5542458wmp.21.2023.04.20.08.03.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:03:55 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Markus Armbruster Subject: [PATCH 2/2] docs/interop: Delete qmp-intro.txt Date: Thu, 20 Apr 2023 16:03:52 +0100 Message-Id: <20230420150352.1039408-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230420150352.1039408-1-peter.maydell@linaro.org> References: <20230420150352.1039408-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org qmp-intro.txt is quite small and provides very little information that isn't already in the documentation elsewhere. Fold the example command lines into qemu-options.hx, and delete the now-unneeded plain text document. While we're touching the qemu-options.hx documentation text, wordsmith it a little bit and improve the rST formatting. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake --- docs/interop/qmp-intro.txt | 88 -------------------------------------- qemu-options.hx | 26 ++++++++--- 2 files changed, 21 insertions(+), 93 deletions(-) delete mode 100644 docs/interop/qmp-intro.txt diff --git a/docs/interop/qmp-intro.txt b/docs/interop/qmp-intro.txt deleted file mode 100644 index 1c745a7af04..00000000000 --- a/docs/interop/qmp-intro.txt +++ /dev/null @@ -1,88 +0,0 @@ - QEMU Machine Protocol - ===================== - -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 qemu-qmp-ref.html QEMU QMP commands and events (auto-generated at build-time) - -[1] https://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=on,wait=off - -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=mon0 -mon chardev=mon0,mode=readline \ - -chardev socket,id=mon1,host=localhost,port=4444,server=on,wait=off \ - -mon chardev=mon1,mode=control,pretty=on - -Please, refer to QEMU's manpage for more information. - -Simple Testing --------------- - -To manually test QMP one can connect with telnet and issue commands by hand: - -$ telnet localhost 4444 -Trying 127.0.0.1... -Connected to localhost. -Escape character is '^]'. -{ - "QMP": { - "version": { - "qemu": { - "micro": 0, - "minor": 0, - "major": 3 - }, - "package": "v3.0.0" - }, - "capabilities": [ - "oob" - ] - } -} - -{ "execute": "qmp_capabilities" } -{ - "return": { - } -} - -{ "execute": "query-status" } -{ - "return": { - "status": "prelaunch", - "singlestep": false, - "running": false - } -} - -Please refer to docs/interop/qemu-qmp-ref.* for a complete command -reference, generated from qapi/qapi-schema.json. - -QMP wiki page -------------- - -https://wiki.qemu.org/QMP diff --git a/qemu-options.hx b/qemu-options.hx index 59bdf67a2c5..2974de2c3ab 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4109,26 +4109,42 @@ DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \ QEMU_ARCH_ALL) SRST ``-qmp dev`` - Like -monitor but opens in 'control' mode. + Like ``-monitor`` but opens in 'control' mode. For example, to make + QMP available on localhost port 4444:: + + -qmp tcp:localhost:4444,server=on,wait=off + + Not all options are configurable via this syntax; for maximum + flexibility use the ``-mon`` option and an accompanying ``-chardev``. + ERST DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \ "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n", QEMU_ARCH_ALL) SRST ``-qmp-pretty dev`` - Like -qmp but uses pretty JSON formatting. + Like ``-qmp`` but uses pretty JSON formatting. ERST DEF("mon", HAS_ARG, QEMU_OPTION_mon, \ "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL) SRST ``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]`` - Setup monitor on chardev name. ``mode=control`` configures - a QMP monitor (a JSON RPC-style protocol) and it is not the - same as HMP, the human monitor that has a "(qemu)" prompt. + Set up a monitor connected to the chardev ``name``. + QEMU supports two monitors: the Human Monitor Protocol + (HMP; for human interaction), and the QEMU Monitor Protocol + (QMP; a JSON RPC-style protocol). + The default is HMP; ``mode=control`` selects QMP instead. ``pretty`` is only valid when ``mode=control``, turning on JSON pretty printing to ease human reading and debugging. + + For example:: + + -chardev socket,id=mon1,host=localhost,port=4444,server=on,wait=off \ + -mon chardev=mon1,mode=control,pretty=on + + enables the QMP monitor on localhost port 4444 with pretty-printing. ERST DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \