From nobody Tue Nov 11 22:49:07 2025 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=1566403743; cv=none; d=zoho.com; s=zohoarc; b=lB4k7aPggO3HILGOpuuTU9mZt4ycdby+J9CEEwGrNy3fOXKVH8rFgCroHFmmasCrj4WB+BLTCI3r7fhOK0kDrknGVpgIx6f02Qkt/A2jrUMnychy4XS3lCt8tJtkC2q5f5ykiV4qQrPJ1UGtYDSA3UIdm/WrLMTaAeAqcPAOvDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566403743; h=Content-Type: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=kDKrJWqXH4HB8dHI4BcNAUKlogbRguMblS8jwztIIdI=; b=F7NoSRZbA8q5h0f62Yby6WfLpmYlYR4Cy3QqKDePNPT5tMQRjHardzrhKjE77dts1xoMQS4/QWV7lqK4nLMp185RmH8QdHrIOskyrskxf9XBLSoCV9VDR1IauxUz7U3m8C+IlZPeemKlcj49Q9CWfy9qBQFIfd/OMGDWQ1MGYEw= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156640374350112.27590322754827; Wed, 21 Aug 2019 09:09:03 -0700 (PDT) Received: from localhost ([::1]:50163 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0TAU-0004G1-3s for importer@patchew.org; Wed, 21 Aug 2019 12:09:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55327) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0T9f-0002qM-2K for qemu-devel@nongnu.org; Wed, 21 Aug 2019 12:08:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0T9d-0002hu-MP for qemu-devel@nongnu.org; Wed, 21 Aug 2019 12:08:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39372) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i0T9a-0002gd-3P for qemu-devel@nongnu.org; Wed, 21 Aug 2019 12:08:07 -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 E47B6368CF for ; Wed, 21 Aug 2019 16:08:04 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-117-142.ams2.redhat.com [10.36.117.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B02A5610C6; Wed, 21 Aug 2019 16:08:04 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2BE1B11655F4; Wed, 21 Aug 2019 18:08:03 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 18:08:02 +0200 Message-Id: <20190821160803.10026-4-armbru@redhat.com> In-Reply-To: <20190821160803.10026-1-armbru@redhat.com> References: <20190821160803.10026-1-armbru@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.30]); Wed, 21 Aug 2019 16:08:04 +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] [PULL 3/4] qdev: Collect HMP handlers command handlers in qdev-monitor.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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Move hmp_device_add(), hmp_device_del() from monitor/hmp-cmds.c to qdev-monitor.c, where they are covered by MAINTAINERS section "QOM", just like qapi/qdev.json. hmp_info_qtree() and hmp_info_qdm() are already there. Signed-off-by: Markus Armbruster Message-Id: <20190709185936.31335-1-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- monitor/hmp-cmds.c | 19 ------------------- qdev-monitor.c | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index e4d4043a3b..b2551c16d1 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -25,7 +25,6 @@ #include "qemu/timer.h" #include "qemu/sockets.h" #include "monitor/monitor-internal.h" -#include "monitor/qdev.h" #include "qapi/error.h" #include "qapi/clone-visitor.h" #include "qapi/opts-visitor.h" @@ -35,7 +34,6 @@ #include "qapi/qapi-commands-migration.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-net.h" -#include "qapi/qapi-commands-qdev.h" #include "qapi/qapi-commands-rocker.h" #include "qapi/qapi-commands-run-state.h" #include "qapi/qapi-commands-tpm.h" @@ -2167,23 +2165,6 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) } } =20 -void hmp_device_add(Monitor *mon, const QDict *qdict) -{ - Error *err =3D NULL; - - qmp_device_add((QDict *)qdict, NULL, &err); - hmp_handle_error(mon, &err); -} - -void hmp_device_del(Monitor *mon, const QDict *qdict) -{ - const char *id =3D qdict_get_str(qdict, "id"); - Error *err =3D NULL; - - qmp_device_del(id, &err); - hmp_handle_error(mon, &err); -} - void hmp_netdev_add(Monitor *mon, const QDict *qdict) { Error *err =3D NULL; diff --git a/qdev-monitor.c b/qdev-monitor.c index a0003bf2a9..8fe5c2cad2 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "hw/sysbus.h" +#include "monitor/hmp.h" #include "monitor/monitor.h" #include "monitor/qdev.h" #include "sysemu/arch_init.h" @@ -844,6 +845,23 @@ void qmp_device_del(const char *id, Error **errp) } } =20 +void hmp_device_add(Monitor *mon, const QDict *qdict) +{ + Error *err =3D NULL; + + qmp_device_add((QDict *)qdict, NULL, &err); + hmp_handle_error(mon, &err); +} + +void hmp_device_del(Monitor *mon, const QDict *qdict) +{ + const char *id =3D qdict_get_str(qdict, "id"); + Error *err =3D NULL; + + qmp_device_del(id, &err); + hmp_handle_error(mon, &err); +} + BlockBackend *blk_by_qdev_id(const char *id, Error **errp) { DeviceState *dev; --=20 2.21.0