Received: from eggs.gnu.org ([2001:4830:134:3::10]:39603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm1dZ-0006Jm-GD for qemu-devel@nongnu.org; Mon, 19 Sep 2016 12:41:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bm1dW-0008MB-95 for qemu-devel@nongnu.org; Mon, 19 Sep 2016 12:41:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm1dW-0008Lu-2G for qemu-devel@nongnu.org; Mon, 19 Sep 2016 12:41:42 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 8F972683FE for ; Mon, 19 Sep 2016 16:41:41 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-37.ams2.redhat.com [10.36.116.37]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8JGfc4a011628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 19 Sep 2016 12:41:41 -0400 From: Markus Armbruster Date: Mon, 19 Sep 2016 18:41:22 +0200 Message-Id: <1474303294-13952-7-git-send-email-armbru@redhat.com> In-Reply-To: <1474303294-13952-1-git-send-email-armbru@redhat.com> References: <1474303294-13952-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 06/18] qapi: Support unregistering QMP commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20160912091913.15831-7-marcandre.lureau@redhat.com> --- include/qapi/qmp/dispatch.h | 1 + qapi/qmp-registry.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/qapi/qmp/dispatch.h b/include/qapi/qmp/dispatch.h index 48c11b6..57651ea 100644 --- a/include/qapi/qmp/dispatch.h +++ b/include/qapi/qmp/dispatch.h @@ -36,6 +36,7 @@ typedef struct QmpCommand =20 void qmp_register_command(const char *name, QmpCommandFunc *fn, QmpCommandOptions options); +void qmp_unregister_command(const char *name); QmpCommand *qmp_find_command(const char *name); QObject *qmp_dispatch(QObject *request); void qmp_disable_command(const char *name); diff --git a/qapi/qmp-registry.c b/qapi/qmp-registry.c index 68b24c9..e805368 100644 --- a/qapi/qmp-registry.c +++ b/qapi/qmp-registry.c @@ -30,6 +30,14 @@ void qmp_register_command(const char *name, QmpCommand= Func *fn, QTAILQ_INSERT_TAIL(&qmp_commands, cmd, node); } =20 +void qmp_unregister_command(const char *name) +{ + QmpCommand *cmd =3D qmp_find_command(name); + + QTAILQ_REMOVE(&qmp_commands, cmd, node); + g_free(cmd); +} + QmpCommand *qmp_find_command(const char *name) { QmpCommand *cmd; --=20 2.5.5