]> git.proxmox.com Git - mirror_qemu.git/blobdiff - monitor/hmp.c
monitor: allow register hmp commands
[mirror_qemu.git] / monitor / hmp.c
index 6c0b33a0b19dff4e31802392ac512914b194e493..d50c3124e1e16aed6fe0988ee64ecc35cddca9ba 100644 (file)
@@ -1089,6 +1089,13 @@ void handle_hmp_command(MonitorHMP *mon, const char *cmdline)
         return;
     }
 
+    if (!cmd->cmd) {
+        /* FIXME: is it useful to try autoload modules here ??? */
+        monitor_printf(&mon->common, "Command \"%.*s\" is not available.\n",
+                       (int)(cmdline - cmd_start), cmd_start);
+        return;
+    }
+
     qdict = monitor_parse_arguments(&mon->common, &cmdline, cmd);
     if (!qdict) {
         while (cmdline > cmd_start && qemu_isspace(cmdline[-1])) {