]> Git Repo - qemu.git/blobdiff - qapi/qmp-registry.c
loader: Add AddressSpace loading support to uImages
[qemu.git] / qapi / qmp-registry.c
index 3e4498a3f6b88980f3c6194a1f7db501270fa111..e8053686f3f3ae7fa4ef5173075a574b765a48e5 100644 (file)
@@ -12,8 +12,7 @@
  *
  */
 
-#include <glib.h>
-#include <string.h>
+#include "qemu/osdep.h"
 #include "qapi/qmp/dispatch.h"
 
 static QTAILQ_HEAD(QmpCommandList, QmpCommand) qmp_commands =
@@ -25,13 +24,20 @@ void qmp_register_command(const char *name, QmpCommandFunc *fn,
     QmpCommand *cmd = g_malloc0(sizeof(*cmd));
 
     cmd->name = name;
-    cmd->type = QCT_NORMAL;
     cmd->fn = fn;
     cmd->enabled = true;
     cmd->options = options;
     QTAILQ_INSERT_TAIL(&qmp_commands, cmd, node);
 }
 
+void qmp_unregister_command(const char *name)
+{
+    QmpCommand *cmd = qmp_find_command(name);
+
+    QTAILQ_REMOVE(&qmp_commands, cmd, node);
+    g_free(cmd);
+}
+
 QmpCommand *qmp_find_command(const char *name)
 {
     QmpCommand *cmd;
This page took 0.023573 seconds and 4 git commands to generate.