From nobody Mon Feb 9 01:20:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560444784; cv=none; d=zoho.com; s=zohoarc; b=Wu2XjLP2r+Gf2QbMUIlEsyE5B8uHK+xixMnRemPDq8b+CWC/lYQH4+DCNy+dnWo036qp7eiilrTRCdb9WaChMWnFpUmbc8RjP8ZjKfQzde9JdcbxeCliQ99spHS/Nd+6WwEMa+W+bpbu2drsX85geQZX4vn8FsYRVsLb1j7aMHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560444784; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=gxRZQ433thUhHYSjjz7QOVEyO6jBrffkL7Pt+PjAWts=; b=eB6nms7uFSVdunpV1mqyOBc00x5vUHafIOiX8FBse4pAYj/74XXNl6pHNhGJsbzDfoQCsOZQpnDZ11ZJyHZ9j+yJJc1bJtB9Y0c3km3I4f8TV9p4sSe5wdgOutg69CbVDi2JzBIjUQplYiVUy7I3FG72v0Yu35Xc6IvT0jmga08= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560444784038174.93199081327487; Thu, 13 Jun 2019 09:53:04 -0700 (PDT) Received: from localhost ([::1]:41788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbSy9-0006RS-Sg for importer@patchew.org; Thu, 13 Jun 2019 12:52:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60010) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbRku-0000aP-NQ for qemu-devel@nongnu.org; Thu, 13 Jun 2019 11:35:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbRkt-0003XJ-60 for qemu-devel@nongnu.org; Thu, 13 Jun 2019 11:35:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33028) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hbRko-0003J3-JP; Thu, 13 Jun 2019 11:35:06 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0DA4822387D; Thu, 13 Jun 2019 15:34:52 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-116-246.ams2.redhat.com [10.36.116.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9DD26108C; Thu, 13 Jun 2019 15:34:47 +0000 (UTC) From: Kevin Wolf To: qemu-devel@nongnu.org Date: Thu, 13 Jun 2019 17:33:58 +0200 Message-Id: <20190613153405.24769-9-kwolf@redhat.com> In-Reply-To: <20190613153405.24769-1-kwolf@redhat.com> References: <20190613153405.24769-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 13 Jun 2019 15:34:56 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 08/15] monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, berrange@redhat.com, qemu-block@nongnu.org, armbru@redhat.com, dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Now that we have a monitor/ subdirectory, let's move hmp.c and qmp.c from the root directory there. As they contain implementations of monitor commands, rename them to {hmp,qmp}-cmds.c, so that {hmp,qmp}.c are free for the HMP and QMP infrastructure. Signed-off-by: Kevin Wolf Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Markus Armbruster --- docs/devel/writing-qmp-commands.txt | 9 +++++---- hmp.c =3D> monitor/hmp-cmds.c | 2 +- qmp.c =3D> monitor/qmp-cmds.c | 2 +- MAINTAINERS | 5 +++-- Makefile.objs | 2 +- monitor/Makefile.objs | 1 + 6 files changed, 12 insertions(+), 9 deletions(-) rename hmp.c =3D> monitor/hmp-cmds.c (99%) rename qmp.c =3D> monitor/qmp-cmds.c (99%) diff --git a/docs/devel/writing-qmp-commands.txt b/docs/devel/writing-qmp-c= ommands.txt index cc6ecd6d5d..46a6c48683 100644 --- a/docs/devel/writing-qmp-commands.txt +++ b/docs/devel/writing-qmp-commands.txt @@ -20,7 +20,7 @@ new QMP command. =20 2. Write the QMP command itself, which is a regular C function. Preferably, the command should be exported by some QEMU subsystem. But it can also = be - added to the qmp.c file + added to the monitor/qmp-cmds.c file =20 3. At this point the command can be tested under the QMP protocol =20 @@ -101,7 +101,8 @@ protocol data. =20 The next step is to write the "hello-world" implementation. As explained earlier, it's preferable for commands to live in QEMU subsystems. But -"hello-world" doesn't pertain to any, so we put its implementation in qmp.= c: +"hello-world" doesn't pertain to any, so we put its implementation in +monitor/qmp-cmds.c: =20 void qmp_hello_world(Error **errp) { @@ -146,7 +147,7 @@ for mandatory arguments). Finally, 'str' is the argumen= t's type, which stands for "string". The QAPI also supports integers, booleans, enumeratio= ns and user defined types. =20 -Now, let's update our C implementation in qmp.c: +Now, let's update our C implementation in monitor/qmp-cmds.c: =20 void qmp_hello_world(bool has_message, const char *message, Error **errp) { @@ -267,7 +268,7 @@ monitor (HMP). =20 With the introduction of the QAPI, HMP commands make QMP calls. Most of the time HMP commands are simple wrappers. All HMP commands implementation exi= st in -the hmp.c file. +the monitor/hmp-cmds.c file. =20 Here's the implementation of the "hello-world" HMP command: =20 diff --git a/hmp.c b/monitor/hmp-cmds.c similarity index 99% rename from hmp.c rename to monitor/hmp-cmds.c index 99414cd39c..712737cd18 100644 --- a/hmp.c +++ b/monitor/hmp-cmds.c @@ -1,5 +1,5 @@ /* - * Human Monitor Interface + * Human Monitor Interface commands * * Copyright IBM, Corp. 2011 * diff --git a/qmp.c b/monitor/qmp-cmds.c similarity index 99% rename from qmp.c rename to monitor/qmp-cmds.c index 6797568444..f1b1e4f08b 100644 --- a/qmp.c +++ b/monitor/qmp-cmds.c @@ -1,5 +1,5 @@ /* - * QEMU Management Protocol + * QEMU Management Protocol commands * * Copyright IBM, Corp. 2011 * diff --git a/MAINTAINERS b/MAINTAINERS index 231964c1da..884f4b16bb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1917,7 +1917,8 @@ Human Monitor (HMP) M: Dr. David Alan Gilbert S: Maintained F: monitor/misc.c -F: hmp.[ch] +F: monitor/hmp* +F: hmp.h F: hmp-commands*.hx F: include/monitor/hmp-target.h F: tests/test-hmp.c @@ -2037,7 +2038,7 @@ F: tests/check-qom-proplist.c QMP M: Markus Armbruster S: Supported -F: qmp.c +F: monitor/qmp* F: monitor/misc.c F: docs/devel/*qmp-* F: docs/interop/*qmp-* diff --git a/Makefile.objs b/Makefile.objs index dd39a70b48..9495fcbc7e 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -83,8 +83,8 @@ common-obj-$(CONFIG_FDT) +=3D device_tree.o ###################################################################### # qapi =20 -common-obj-y +=3D qmp.o hmp.o common-obj-y +=3D qapi/ +common-obj-y +=3D monitor/ endif =20 ####################################################################### diff --git a/monitor/Makefile.objs b/monitor/Makefile.objs index e783b0616b..a7170af6e1 100644 --- a/monitor/Makefile.objs +++ b/monitor/Makefile.objs @@ -1 +1,2 @@ obj-y +=3D misc.o +common-obj-y +=3D qmp-cmds.o hmp-cmds.o --=20 2.20.1