Skip to content

Commit

Permalink
monitor: call sortcmdlist() only one time
Browse files Browse the repository at this point in the history
It doesn't need to be done for every monitor, so change it.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
  • Loading branch information
Wenchao Xia authored and Luiz Capitulino committed Aug 30, 2013
1 parent d1a9756 commit d038317
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions monitor.c
Expand Up @@ -4763,6 +4763,7 @@ void monitor_init(CharDriverState *chr, int flags)

if (is_first_init) {
monitor_protocol_event_init();
sortcmdlist();
is_first_init = 0;
}

Expand Down Expand Up @@ -4792,8 +4793,6 @@ void monitor_init(CharDriverState *chr, int flags)
QLIST_INSERT_HEAD(&mon_list, mon, entry);
if (!default_mon || (flags & MONITOR_IS_DEFAULT))
default_mon = mon;

sortcmdlist();
}

static void bdrv_password_cb(Monitor *mon, const char *password, void *opaque)
Expand Down

0 comments on commit d038317

Please sign in to comment.