Patchwork [V10,06/15] monitor: call sortcmdlist() only one time

login
register
mail settings
Submitter Wayne Xia
Date Aug. 27, 2013, 12:38 p.m.
Message ID <1377607107-11612-7-git-send-email-xiawenc@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/270107/
State New
Headers show

Comments

Wayne Xia - Aug. 27, 2013, 12:38 p.m.
It doesn't need to be done for every monitor, so change it.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
---
 monitor.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch

diff --git a/monitor.c b/monitor.c
index fffb434..db4d441 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4762,6 +4762,7 @@  void monitor_init(CharDriverState *chr, int flags)
 
     if (is_first_init) {
         monitor_protocol_event_init();
+        sortcmdlist();
         is_first_init = 0;
     }
 
@@ -4791,8 +4792,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)