From patchwork Mon Dec 18 10:53:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 10118763 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 80BFB60390 for ; Mon, 18 Dec 2017 10:54:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 747342624A for ; Mon, 18 Dec 2017 10:54:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6900C28F8F; Mon, 18 Dec 2017 10:54:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E65A92898D for ; Mon, 18 Dec 2017 10:54:40 +0000 (UTC) Received: from localhost ([::1]:57849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQt4B-0007Pt-Lx for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Dec 2017 05:54:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQt3H-0006o2-6j for qemu-devel@nongnu.org; Mon, 18 Dec 2017 05:53:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQt3D-0003TN-8X for qemu-devel@nongnu.org; Mon, 18 Dec 2017 05:53:43 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54910) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eQt3C-0003RJ-Vl for qemu-devel@nongnu.org; Mon, 18 Dec 2017 05:53:39 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vBIAnCWB134517 for ; Mon, 18 Dec 2017 05:53:36 -0500 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2exbagtuws-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 18 Dec 2017 05:53:36 -0500 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 18 Dec 2017 05:53:35 -0500 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 18 Dec 2017 05:53:31 -0500 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vBIArVdw45744306; Mon, 18 Dec 2017 10:53:31 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 18842AE04B; Mon, 18 Dec 2017 05:54:34 -0500 (EST) Received: from localhost.localdomain (unknown [9.85.195.168]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id 66B8AAE03B; Mon, 18 Dec 2017 05:54:32 -0500 (EST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Date: Mon, 18 Dec 2017 08:53:18 -0200 X-Mailer: git-send-email 2.13.6 X-TM-AS-GCONF: 00 x-cbid: 17121810-0048-0000-0000-000002161BDE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008222; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000244; SDB=6.00961965; UDB=6.00486560; IPR=6.00741960; BA=6.00005747; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018600; XFM=3.00000015; UTC=2017-12-18 10:53:33 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17121810-0049-0000-0000-0000437DA505 Message-Id: <20171218105318.30367-1-danielhb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-12-18_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1712180144 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH v1 1/1] qmp: marking qmp_cpu as deprecated X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Henrique Barboza , armbru@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP qmp_cpu is a nop that was created a while ago in commit 755f196898 ("qapi: Convert the cpu command") for the sake of compatibility, due to the existence of hmp_cpu. Today, there is no need or requirement to keep it as is. QMP is meant to be as stateless as possible, thus any QMP command that needs a specific monitor CPU setup should provide it in its arguments, instead of relying in the current QMP monitor state. This patch flags qmp_cpu as deprecated in qemu-doc.texi and changes qmp_cpu body to show a deprecation message if used. Signed-off-by: Daniel Henrique Barboza --- Although I've changed the behavior of qmp_cpu to return an error instead of doing nothing, no errors were found in the Travis build of the patch. Code inspection confirms that qmp_cpu isn't being used in QEMU. A quick inspection in Libvirt code shows that there is no reference to 'qmp_cpu' there either, but to be sure I've CCed Daniel here so he can comment/confirm if Libvirt does not care for this change. qemu-doc.texi | 6 ++++++ qmp.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index f7317dfc66..2b63f9a325 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2516,6 +2516,12 @@ subsystem image. The ``convert -s snapshot_id_or_name'' argument is obsoleted by the ``convert -l snapshot_param'' argument instead. +@section System emulator machine protocol commands + +@subsection qmp_cpu (since 2.12.0) + +The ``qmp_cpu'' command is deprecated. Do not use this command. + @section System emulator human monitor commands @subsection host_net_add (since 2.10.0) diff --git a/qmp.c b/qmp.c index e8c303116a..d8543d713d 100644 --- a/qmp.c +++ b/qmp.c @@ -115,7 +115,7 @@ void qmp_system_powerdown(Error **erp) void qmp_cpu(int64_t index, Error **errp) { - /* Just do nothing */ + error_setg(errp, "qmp_cpu is deprecated, do not use this command"); } void qmp_cpu_add(int64_t id, Error **errp)