sim-card
/
qemu
Archived
10
0
Fork 0

QMP: Drop dead code

The first if/else clause in handler_audit() makes no sense for two
reasons:

  1. this function is now called only by QMP code, so testing if
     it's a QMP call makes no sense anymore

  2. the else clause first asserts that there's no error in the
     monitor object, then it tries to free it!

Just drop it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
Luiz Capitulino 2010-11-22 16:35:09 -02:00
parent c01e688531
commit 6d44143054
1 changed files with 34 additions and 40 deletions

View File

@ -3891,7 +3891,6 @@ void monitor_set_error(Monitor *mon, QError *qerror)
static void handler_audit(Monitor *mon, const mon_cmd_t *cmd, int ret)
{
if (monitor_ctrl_mode(mon)) {
if (ret && !monitor_has_error(mon)) {
/*
* If it returns failure, it must have passed on error.
@ -3929,11 +3928,6 @@ static void handler_audit(Monitor *mon, const mon_cmd_t *cmd, int ret)
cmd->name, mon_print_count_get(mon));
}
#endif
} else {
assert(!monitor_has_error(mon));
QDECREF(mon->error);
mon->error = NULL;
}
}
static void handle_user_command(Monitor *mon, const char *cmdline)