Skip to content
  • Peter Xu's avatar
    71da4667
    monitor: separate QMP parser and dispatcher · 71da4667
    Peter Xu authored
    
    
    Originally QMP goes through these steps:
    
      JSON Parser --> QMP Dispatcher --> Respond
          /|\    (2)                (3)     |
       (1) |                               \|/ (4)
           +---------  main thread  --------+
    
    This patch does this:
    
      JSON Parser     QMP Dispatcher --> Respond
          /|\ |           /|\       (4)     |
           |  | (2)        | (3)            |  (5)
       (1) |  +----->      |               \|/
           +---------  main thread  <-------+
    
    So the parsing job and the dispatching job is isolated now.  It gives us
    a chance in follow up patches to totally move the parser outside.
    
    The isolation is done using one QEMUBH. Only one dispatcher QEMUBH is
    used for all the monitors.
    
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Message-Id: <20180309090006.10018-15-peterx@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    [eblake: grammar tweaks, rebase to qobject_to()]
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    71da4667
    monitor: separate QMP parser and dispatcher
    Peter Xu authored
    
    
    Originally QMP goes through these steps:
    
      JSON Parser --> QMP Dispatcher --> Respond
          /|\    (2)                (3)     |
       (1) |                               \|/ (4)
           +---------  main thread  --------+
    
    This patch does this:
    
      JSON Parser     QMP Dispatcher --> Respond
          /|\ |           /|\       (4)     |
           |  | (2)        | (3)            |  (5)
       (1) |  +----->      |               \|/
           +---------  main thread  <-------+
    
    So the parsing job and the dispatching job is isolated now.  It gives us
    a chance in follow up patches to totally move the parser outside.
    
    The isolation is done using one QEMUBH. Only one dispatcher QEMUBH is
    used for all the monitors.
    
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Message-Id: <20180309090006.10018-15-peterx@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    [eblake: grammar tweaks, rebase to qobject_to()]
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
Loading