monitor: Split monitor_init in HMP and QMP function
Instead of mixing HMP and QMP monitors in the same function, separate the monitor creation function for both. While in theory, one could pass both MONITOR_USE_CONTROL and MONITOR_USE_READLINE before this patch and both flags would do something, readline support is tightly coupled with HMP: QMP never feeds its input to readline, and the tab completion function treats the input as an HMP command. Therefore, this configuration is useless. After this patch, the QMP path asserts that MONITOR_USE_READLINE is not set. The HMP path can be used with or without MONITOR_USE_READLINE, like before. Signed-off-by: NKevin Wolf <kwolf@redhat.com> Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: NMarkus Armbruster <armbru@redhat.com> Message-Id: <20190613153405.24769-3-kwolf@redhat.com> [Zero initialization of Monitor moved from monitor_data_init() to callers] Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Showing
想要评论请 注册 或 登录