monitor: call sortcmdlist() only one time
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>
diff --git a/monitor.c b/monitor.c
index b8f79a5..457948d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4763,6 +4763,7 @@
if (is_first_init) {
monitor_protocol_event_init();
+ sortcmdlist();
is_first_init = 0;
}
@@ -4792,8 +4793,6 @@
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)