hmp: introduce cmd_available
commit4cd29274729f6bfbb0202563929225bbbb861c1b
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 27 Oct 2020 08:40:02 +0000 (27 04:40 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 10 Dec 2020 17:15:15 +0000 (10 12:15 -0500)
tree27898f19996c479fbfaddd9c8bb2a1899c9507c5
parentee55686efbd7de8dce8c1437c6e38fb4f5398c24
hmp: introduce cmd_available

Combine the RUN_STATE_PRECONFIG and cmd_can_preconfig checks
into a single function, to avoid repeating the same expression
(or its negation after applying DeMorgan's rule) over and
over again.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
monitor/hmp.c