On 9/10/25 18:03, Daniel P. Berrangé wrote:
A number of callers use monitor_cur() followed by !monitor_cur_is_qmp().

This is undesirable because monitor_cur_is_qmp() will itself call
monitor_cur() again, and monitor_cur() must acquire locks and do
hash table lookups. Introducing a monitor_cur_hmp() helper will
combine the two operations into one reducing cost.

Signed-off-by: Daniel P. Berrangé<berra...@redhat.com>
---
  include/monitor/monitor.h      |  1 +
  monitor/monitor.c              | 14 ++++++++++++++
  stubs/monitor-core.c           |  5 +++++
  tests/unit/test-util-sockets.c |  1 +
  4 files changed, 21 insertions(+)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to