Revision 956f1a0d monitor.c

b/monitor.c
367 367
    const mon_cmd_t *cmd;
368 368
    const char *item = qdict_get_try_str(qdict, "item");
369 369

  
370
    if (!item)
370
    if (!item) {
371
        assert(monitor_ctrl_mode(mon) == 0);
371 372
        goto help;
373
    }
372 374

  
373 375
    for (cmd = info_cmds; cmd->name != NULL; cmd++) {
374 376
        if (compare_cmd(item, cmd->name))
375 377
            break;
376 378
    }
377 379

  
378
    if (cmd->name == NULL)
380
    if (cmd->name == NULL) {
381
        if (monitor_ctrl_mode(mon)) {
382
            qemu_error_new(QERR_COMMAND_NOT_FOUND, item);
383
            return;
384
        }
379 385
        goto help;
386
    }
380 387

  
381 388
    if (monitor_handler_ported(cmd)) {
382 389
        cmd->mhandler.info_new(mon, ret_data);
......
390 397
                cmd->user_print(mon, *ret_data);
391 398
        }
392 399
    } else {
393
        cmd->mhandler.info(mon);
400
        if (monitor_ctrl_mode(mon)) {
401
            /* handler not converted yet */
402
            qemu_error_new(QERR_COMMAND_NOT_FOUND, item);
403
        } else {
404
            cmd->mhandler.info(mon);
405
        }
394 406
    }
395 407

  
396 408
    return;

Also available in: Unified diff