Skip to content
Snippets Groups Projects
  • Paolo Bonzini's avatar
    6ee7c82d
    monitor: do not use mb_read/mb_set for suspend_cnt · 6ee7c82d
    Paolo Bonzini authored
    
    Clean up monitor_event to just use monitor_suspend/monitor_resume,
    using mon->mux_out to protect against incorrect nesting (especially
    on startup).
    
    The only remaining case of reading suspend_cnt is in the can_read
    callback, which is just advisory and can use qatomic_read.
    
    As an extra benefit, mux_out is now simply protected by mon_lock.
    Also, moving the prompt to the beginning of the main loop removes
    it from the output in some error cases where QEMU does not actually
    start successfully.  It is not a full fix and it would be nice to
    also remove the monitor heading, but this is already a small (though
    unintentional) improvement.
    
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    6ee7c82d
    History
    monitor: do not use mb_read/mb_set for suspend_cnt
    Paolo Bonzini authored
    
    Clean up monitor_event to just use monitor_suspend/monitor_resume,
    using mon->mux_out to protect against incorrect nesting (especially
    on startup).
    
    The only remaining case of reading suspend_cnt is in the can_read
    callback, which is just advisory and can use qatomic_read.
    
    As an extra benefit, mux_out is now simply protected by mon_lock.
    Also, moving the prompt to the beginning of the main loop removes
    it from the output in some error cases where QEMU does not actually
    start successfully.  It is not a full fix and it would be nice to
    also remove the monitor heading, but this is already a small (though
    unintentional) improvement.
    
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>